fix(android): Only request permissions that are defined in the manifest#85
Open
OS-pedrogustavobilro wants to merge 7 commits into
Open
fix(android): Only request permissions that are defined in the manifest#85OS-pedrogustavobilro wants to merge 7 commits into
OS-pedrogustavobilro wants to merge 7 commits into
Conversation
enableLocationManagerFallback=true
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR changes the permission logic when calling
getCurrentPositionorwatchPosition, to look at permissions defined in the manifest before requesting them.This PR also updates the example app and adds additional documentation (docusaurus admonition style, which doesn't look too pretty on GH markdown but looks proper on capacitor docs website, which is the main reference point for docs) regarding the permissions - More documentation and changes may come in future PRs.
Context
Google Play Permission policy updates are tightening the declaration of
ACCESS_FINE_LOCATIONin android apps for Android 17. Prior to this PR, the plugin was assumingACCESS_FINE_LOCATIONwas defined in manifest whenenableHighAccuracywas set totrue(or for Android < 12), but there may be apps that just haveACCESS_COARSE_LOCATION, and this PR fixes the permission logic for such apps.Internal JIRA ref: https://outsystemsrd.atlassian.net/browse/RMET-5198
Type of changes
Platforms affected
Tests
Feel free to test with the Capacitor app in this repo, with different Android versions, and also keeping / removing
ACCESS_FINE_LOCATIONfrom the app's manifest.Checklist