Baseflow / Baseflow/flutter-geolocator
Cannot request Always permission in iOS
- Dominant language
- Dart
- Stars
- 1.3k
- Forks
- 803
- Avg merge
- 8h 16m
- Merged PRs (30d)
- 1
Description
## 🐛 Bug Report
The app can never request 'always' permission in iOS.
### Expected behavior
The app should be able to request 'always' permission in iOS
**Version:** 7.7.1
**Platform:**
:iphone: iOS 14.4
This seems to be because of this:
https://github.com/Baseflow/flutter-geolocator/blob/master/geolocator_apple/apple/Classes/Handlers/PermissionHandler.m#L56
It first checks if there's a "when in use" description. It should first check if there's "Always" or "When in use and always". If I remove the "When in use description" I get the following error in the debug log:
> This app has attempted to access privacy-sensitive data without a usage description. The app’s Info.plist **must contain both** “NSLocationAlwaysAndWhenInUseUsageDescription” and “NSLocationWhenInUseUsageDescription” keys with string values explaining to the user how the app uses this data
Please fix this even if the Geolocator itself doesn't support background location. I'm using it to handle permissions and then use another plugin for background location updates.
Contributor guide
Research direction
Inspect geolocator_apple/apple/Classes/Handlers/PermissionHandler.m around line 56, then review the required NSLocationAlwaysAndWhenInUseUsageDescription and NSLocationWhenInUseUsageDescription keys in Info.plist. Reproduce the permission request on iOS 14.4 with both keys present; done means the app can request Always permission without the privacy-sensitive data error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, ios, objective-c
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 42/100