[iOS] User presses while using, getBackgroundPermissionsAsync canAskAgain is true (should be false)
See original GitHub issueSummary
In my project I am using canAskAgain to determine whether or not to present the system permission dialog if its true, or a link to open Settings if it’s false. This means that if canAskAgain is lying about being TRUE, then the user can get stuck on a screen that can’t present the modal from requestBackgroundPermissionsAsync.
Reproduction steps
- Run
Location.requestBackgroundPermissionsAsync()
and grant “While using” - Log the result of
Location.getBackgroundPermissionsAsync()
:
Result:
{"canAskAgain": true, "expires": "never", "granted": false, "status": "undetermined"}
Managed or bare workflow? If you have ios/
or android/
directories in your project, the answer is bare!
bare
What platform(s) does this occur on?
iOS
SDK Version (managed workflow only)
No response
Environment
Expo CLI 4.1.6 environment info: System: OS: macOS 11.4 Shell: 5.8 - /bin/zsh Binaries: Node: 16.4.0 - /opt/homebrew/bin/node Yarn: 1.22.10 - /opt/homebrew/Cellar/node/16.0.0_1/bin/yarn npm: 7.3.0 - /usr/local/bin/npm Watchman: 2021.06.07.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.10.1 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4 Android SDK: API Levels: 28, 29, 30 Build Tools: 28.0.3, 29.0.2, 30.0.2, 30.0.3 System Images: android-29 | Google APIs Intel x86 Atom_64, android-30 | Google APIs Intel x86 Atom IDEs: Android Studio: 4.2 AI-202.7660.26.42.7351085 Xcode: 12.5.1/12E507 - /usr/bin/xcodebuild npmPackages: @expo/webpack-config: ^0.12.78 => 0.12.81 expo: ^41.0.0 => 41.0.1 react: 16.13.1 => 16.13.1 react-native: 0.63.4 => 0.63.4 Expo Workflow: bare
Reproducible demo or steps to reproduce from a blank project
Reproduction steps
- Run
Location.requestBackgroundPermissionsAsync()
and grant “While using” - Log the result of
Location.getBackgroundPermissionsAsync()
:
Result:
{"canAskAgain": true, "expires": "never", "granted": false, "status": "undetermined"}
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:8 (5 by maintainers)
Top GitHub Comments
Issue is still legit. I’ve made a workaround that is a “lie detector” which I can post below in case it helps anyone. Taken out of context though, so it’s very hard to parse through!
This issue was closed because it has been inactive for 7 days since being marked as stale. Please open a new issue if you believe you are encountering a related problem.