Skip to content
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

feat(geolocation): Add new alias for coarse location #684

Merged
merged 2 commits into from
Nov 8, 2021

Conversation

jcesarmobile
Copy link
Member

On Android 12 users are prompted to choose between Precise location (ACCESS_FINE_LOCATION permission)or Approximate location (ACCESS_COARSE_LOCATION permission)

This PR fixes the problem where the user only granted ACCESS_COARSE_LOCATION permission, it was rejecting as permissions not granted, but Android docs say that apps should still provide a location instead of error (despite it's not precise)

It also allows to check/request the status of ACCESS_COARSE_LOCATION permission independently.
Didn't add add another alias for fine location because the existing location alias can be used for that, as granting ACCESS_FINE_LOCATION also grants ACCESS_COARSE_LOCATION, so location alias will appear as granted if ACCESS_FINE_LOCATION is granted.

On Android 12+ the plugin will only use the location alias (that requests ACCESS_FINE_LOCATION permission) if the enableHighAccuracy is set to true, otherwise it will only request the new coarseLocation alias. On older Android versions it keeps requesting location alias to avoid possible problems)

closes #676

@jcesarmobile jcesarmobile merged commit 7563040 into main Nov 8, 2021
@jcesarmobile jcesarmobile deleted the geolocation-12 branch November 8, 2021 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Geolocation: Android 12 Approximate Location Treated as Location Permission Denied
2 participants