You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2021/09/20 05:59:48 UTC

[GitHub] [cordova-plugin-geolocation] bhandaribhumin opened a new issue #235: !important Android 12 new approximate location and precise location

bhandaribhumin opened a new issue #235:
URL: https://github.com/apache/cordova-plugin-geolocation/issues/235


   # Feature Request
   precise location work expectedly but when user select approximate location got error 
   
   > getCurrentPosition() : 
   ```
   PositionError {code: 1, message: "Illegal Access"}	
   code: 1	
   message: "Illegal Access"	
   __proto__: Object
   
   ```
   ## Motivation Behind Feature
   
   it solve current position coords.
   
   
   ## Feature Description
   Android BETA change log: 
   
   https://developer.android.com/about/versions/12/approximate-location#user-choice-approximate-precise
   
   
   
   ## Alternatives or Workarounds
   
   Not found workaround yet but observe some points:
   
   **New location changes might need fixes from both ts and plugin side
   Plugin Changes : Handle Fine location not requested, send a new message
   TS Changes : Handle this updated message from plugin**
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-geolocation] breautek edited a comment on issue #235: !important Android 12 new approximate location and precise location

Posted by GitBox <gi...@apache.org>.
breautek edited a comment on issue #235:
URL: https://github.com/apache/cordova-plugin-geolocation/issues/235#issuecomment-923045451


   I believe this plugin is already compatible. It seems like if you request `FINE` location, then starting API 31, you **must** also request `COARSE` permission at the same time.
   
   > If your app targets Android 12 and you request the ACCESS_FINE_LOCATION permission, you must also request the ACCESS_COARSE_LOCATION permission. You must include both permissions in a single runtime request. If you try to request only ACCESS_FINE_LOCATION, the system ignores the request and logs the following error message in Logcat: ACCESS_FINE_LOCATION must be requested with ACCESS_COARSE_LOCATION.
   
   The reason why I believe this plugin is already compatible is because we old an array containing both of these permissions here:
   
   https://github.com/apache/cordova-plugin-geolocation/blob/8be9229c44a4a00391a8e1be832758a80fbd5b4c/src/android/Geolocation.java#L41
   
   And when requesting:
   
   https://github.com/apache/cordova-plugin-geolocation/blob/8be9229c44a4a00391a8e1be832758a80fbd5b4c/src/android/Geolocation.java#L100-L103
   
   OR
   
   https://github.com/apache/cordova-plugin-geolocation/blob/8be9229c44a4a00391a8e1be832758a80fbd5b4c/src/android/Geolocation.java#L49-L57
   
   However, the issue with coarse only not working is probably due to the fact that it appears that if any of the requested permissions are denied, then we treat the entire prompt as a denial:
   
   https://github.com/apache/cordova-plugin-geolocation/blob/8be9229c44a4a00391a8e1be832758a80fbd5b4c/src/android/Geolocation.java#L64-L82
   
   This is obviously problematic. I think it should only throw an error if `highAccuracy` was requested, but `FINE` location is not granted.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-geolocation] jcesarmobile commented on issue #235: !important Android 12 new approximate location and precise location

Posted by GitBox <gi...@apache.org>.
jcesarmobile commented on issue #235:
URL: https://github.com/apache/cordova-plugin-geolocation/issues/235#issuecomment-984536156


   I think the plugin behavior should be changed to consider that the permission has been granted if on Android 12 and only coarse permission was granted, or at least if `highAccuracy` is false.
   
   But sadly there is a bug on the WebView that still won't get location in some cases even if we consider it as granted
   https://bugs.chromium.org/p/chromium/issues/detail?id=1269362
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-geolocation] bhandaribhumin commented on issue #235: !important Android 12 new approximate location and precise location

Posted by GitBox <gi...@apache.org>.
bhandaribhumin commented on issue #235:
URL: https://github.com/apache/cordova-plugin-geolocation/issues/235#issuecomment-923650775


   @breautek  Thanks for the observation I already try to debug the code but `ACCESS_COARSE_LOCATION` failed all the time. Found valid issue on beta and it is not fixed yet. Here is the issue link [google-issuetracker](https://issuetracker.google.com/issues/197880441?pli=1).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-geolocation] breautek commented on issue #235: !important Android 12 new approximate location and precise location

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #235:
URL: https://github.com/apache/cordova-plugin-geolocation/issues/235#issuecomment-923045451


   I believe this plugin is already compatible. It seems like if you request `FINE` location, then starting API 31, you **must** also request `COARSE` permission at the same time.
   
   > If your app targets Android 12 and you request the ACCESS_FINE_LOCATION permission, you must also request the ACCESS_COARSE_LOCATION permission. You must include both permissions in a single runtime request. If you try to request only ACCESS_FINE_LOCATION, the system ignores the request and logs the following error message in Logcat: ACCESS_FINE_LOCATION must be requested with ACCESS_COARSE_LOCATION.
   
   The reason why I believe this plugin is already compatible is because we old an array containing both of these permissions here:
   
   https://github.com/apache/cordova-plugin-geolocation/blob/8be9229c44a4a00391a8e1be832758a80fbd5b4c/src/android/Geolocation.java#L41
   
   And when requesting:
   
   https://github.com/apache/cordova-plugin-geolocation/blob/8be9229c44a4a00391a8e1be832758a80fbd5b4c/src/android/Geolocation.java#L100-L103
   
   OR
   
   https://github.com/apache/cordova-plugin-geolocation/blob/8be9229c44a4a00391a8e1be832758a80fbd5b4c/src/android/Geolocation.java#L49-L57
   
   However, the issue with coarse only not working is probably due to the fact that it appears that if any of the requested permissions are denied, then we treat the entire prompt as a denial:
   
   https://github.com/apache/cordova-plugin-geolocation/blob/8be9229c44a4a00391a8e1be832758a80fbd5b4c/src/android/Geolocation.java#L64-L82
   
   This is obviously problematic. It should only throw an error if `highAccuracy` was requested, but `FINE` location is not granted.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-geolocation] bhandaribhumin edited a comment on issue #235: !important Android 12 new approximate location and precise location

Posted by GitBox <gi...@apache.org>.
bhandaribhumin edited a comment on issue #235:
URL: https://github.com/apache/cordova-plugin-geolocation/issues/235#issuecomment-923650775


   @breautek  Thanks for the observation I already try to debugging the code but `ACCESS_COARSE_LOCATION` failed all the time. Found valid issue on beta and it is not fixed yet. Here is the issue link [google-issuetracker](https://issuetracker.google.com/issues/197880441?pli=1).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org