Skip to content

fix(apple): report locationAlways as denied until Always has been requested - #1577

Merged
mvanbeusekom merged 1 commit into
Baseflow:mainfrom
khb-works:fix/ios-location-always-status
Oct 23, 2026
Merged

mvanbeusekom merged 1 commit into
Baseflow:mainfrom
khb-works:fix/ios-location-always-status

Conversation

@khb-works

Copy link
Copy Markdown
Contributor

On iOS, Permission.locationAlways.status returns permanentlyDenied when only "When In Use" is granted, even if the app has never asked for "Always". In that state the "Always" prompt can still be shown, so apps that check the status first send users to Settings for no reason.

The plugin already sets UserDefaultPermissionRequestedKey when it requests "Always". This change uses it in the status check: denied until "Always" has been requested, permanentlyDenied after that. The request flow is unchanged.

Fixes #1145

Tested on an iOS 17.5 simulator with the example app:

  • When In Use only, Always never asked: denied (was permanentlyDenied)
  • After "Keep Only While Using": permanentlyDenied
  • After "Change to Always Allow": granted

Pre-launch Checklist

  • I made sure the project builds.
  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is does not need version changes.
  • I updated CHANGELOG.md to add a description of the change.
  • I updated/added relevant documentation (doc comments with ///).
  • I rebased onto main.
  • I added new tests to check the change I am making, or this PR does not need tests.
  • I made sure all existing and new tests are passing.
  • I ran dart format . and committed any changes.
  • I ran flutter analyze and fixed any errors.

…uested

On iOS, locationAlways.status returned permanentlyDenied whenever only
When In Use was granted, even before the plugin had asked for Always.
Use the existing UserDefaultPermissionRequestedKey flag to return denied
until Always has been requested.

Fixes Baseflow#1145
@mvanbeusekom

Copy link
Copy Markdown
Member

Thank you for this contribution. Changes look good.

@mvanbeusekom
mvanbeusekom merged commit edeb2e1 into Baseflow:main Oct 23, 2026
1 check passed
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.

[Bug]: Permission.always.status returns permanentlyDenied even when can be requested

2 participants