-
-
Notifications
You must be signed in to change notification settings - Fork 853
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UserLocation does not use high accuracy on Android 12 #1795
Comments
Good job spotting that is the issue that occurs on Android 12. I think the solution is describe here https://developer.android.com/training/location/permissions#approximate-request so more of us can read it up. |
In my case I call requestAndroidLocationPermissions which implementaion is here Lines 45 to 48 in dda13db
It ask for both Coarse and Fine locations. On Android 11 and below user is shown a dialog for grating location permission. On Android 12 user in addition can decide also to give Precise or Approximate location. As written in the https://developer.android.com/training/location/permissions#approximate-request app should always request both Fine and Coarse permissions together. There is no way to force user to only grant Fine precision. However user can be informed about his/her decision and ask to upgrade to Precise. https://developer.android.com/training/location/permissions#upgrade-to-precise This can be done by requesting again for both Coarse and Fine location again. As I don't have a Android 12 telephone at the moment, @benjamin-sweney can you please confirm this behaviour? |
I have the same issue on Android 12 |
@RobertSasak I use the |
Solution is described mapbox/mapbox-gl-native-android#730 and https://docs.mapbox.com/android/maps/guides/user-location/#location-provider
|
Describe the bug
After users have upgraded to Android 12 the UserLocation component no longer appears to use high accuracy mode. This is indicated by the users location darting around (as opposed to being true to their actual location) and the location status icon is no longer shown. On Android 11 the location status icon was shown regardless.
Using React Native Geolocation with a watch and high accuracy mode turned on corrects to the expected behaviour showing an accurate location and the location status icon.
To Reproduce
Use a UserLocation component on any Android 12 device. I have been using a S20 FE and an S21 to confirm (Android 12 vs still on Android 11)
Example:
Expected behavior
The users location is shown correctly and the location status icon is shown indicating use of high accuracy location.
Actual behavior
Users location darts around and no location status icon is shown.
Screenshots
Versions (please complete the following information):
Additional context
N/A
The text was updated successfully, but these errors were encountered: