Fix/android ask every time permanently denied - #1559
Merged
mvanbeusekom merged 4 commits intoSep 4, 2026
Merged
Conversation
On Android 11+, selecting "Ask every time" in the app settings revokes the permission as a one-time permission, which clears FLAG_PERMISSION_USER_SET. shouldShowRequestPermissionRationale() then returns false, exactly as for a permission that was never requested or one that is permanently denied. The plugin combined that with a "was denied before" flag in SharedPreferences that was never cleared, so `status` kept reporting permanentlyDenied even though the OS would show the request dialog again (Baseflow#1206). - A status check now always reports `denied` for a denied runtime permission; Android offers no API to tell the three states apart. - `request()` resolves permanentlyDenied from the change of the rationale flag across the request (true -> false means the second denial), falling back to the stored flag when the OS resolved the request without a dialog. - The stored flag is cleared whenever the permission is observed granted. - Docs, README and changelogs updated; versions bumped. Verified on an Android 16 emulator with the example app: the old build reports permanentlyDenied after "Ask every time", the fixed build reports denied and shows the dialog on the next request. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Contributor
Author
|
@mvanbeusekom please review |
mvanbeusekom
requested changes
Sep 4, 2026
mvanbeusekom
left a comment
Member
There was a problem hiding this comment.
Thank you for this PR, I like the idea of no longer returning a permanently denied status from the permission check.
The changes look solid and I really like the "ANDROID_PERMANENTLY_DENIED_FIX_GUIDE.md". However I am missing a bit the advertisement of the guide. It would be a shame if nobody read the guide, because it cannot be found. To fix this, lets link the guide from the permission_handler/README.md and permission_handler/CHANGELOG.md files.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…nently-denied' into fix/android-ask-every-time-permanently-denied # Conflicts: # ANDROID_PERMANENTLY_DENIED_FIX_GUIDE.md
Contributor
Author
|
@mvanbeusekom please review again. |
mvanbeusekom
approved these changes
Sep 4, 2026
Contributor
Author
|
Oh nice! Thank you @mvanbeusekom . i am a contributor now haha niceeee. |
Member
|
You sure are! Thanks a lot, credits to you. |
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.
Replace this paragraph with a short description of what issue this pull request (PR) solves and provide a description of the change. Consider including before/after screenshots.
List at least one fixed issue.
Pre-launch Checklist
pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or this PR is does not need version changes.CHANGELOG.mdto add a description of the change.///).main.dart format .and committed any changes.flutter analyzeand fixed any errors.