Skip to content

fix(android): Only request permissions that are defined in the manifest#85

Open
OS-pedrogustavobilro wants to merge 7 commits into
mainfrom
fix/RMET-5198/manifest-permissions
Open

fix(android): Only request permissions that are defined in the manifest#85
OS-pedrogustavobilro wants to merge 7 commits into
mainfrom
fix/RMET-5198/manifest-permissions

Conversation

@OS-pedrogustavobilro

@OS-pedrogustavobilro OS-pedrogustavobilro commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

⚠️ 🤖 AI-assisted PR with claude, with manual verification by me 🤖 ⚠️

Description

This PR changes the permission logic when calling getCurrentPosition or watchPosition, 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_LOCATION in android apps for Android 17. Prior to this PR, the plugin was assuming ACCESS_FINE_LOCATION was defined in manifest when enableHighAccuracy was set to true (or for Android < 12), but there may be apps that just have ACCESS_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

  • Fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Refactor (cosmetic changes)
  • Breaking change (change that would cause existing functionality to not work as expected)

Platforms affected

  • Android
  • iOS
  • JavaScript

Tests

Feel free to test with the Capacitor app in this repo, with different Android versions, and also keeping / removing ACCESS_FINE_LOCATION from the app's manifest.

Checklist

  • Code follows code style of this project
  • CHANGELOG.md file is correctly updated
  • Changes require an update to the documentation
    • Documentation has been updated accordingly

@OS-pedrogustavobilro OS-pedrogustavobilro marked this pull request as draft June 15, 2026 13:10
@OS-pedrogustavobilro OS-pedrogustavobilro changed the title fix(android): Return error when user rejects request to turn on location with enableLocationManagerFallback=true fix(android): Only request permissions that are defined in the manifest Jun 15, 2026
@OS-pedrogustavobilro OS-pedrogustavobilro marked this pull request as ready for review June 15, 2026 13:30
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.

1 participant