When using iOS 10 I need users to choose between never allowing location and always allowing locations, so I added the key NSLocationAlwaysUsageDescription
in the Info.plist.
Now with the new iOS 11 release, I need to add the following two keys to get the location permission prompt - NSLocationAlwaysAndWhenInUseUsageDescription
and NSLocationWhenInUseUsageDescription
.
When I try to remove the seemingly redundant NSLocationWhenInUseUsageDescription
, it doesn't allow showing the location prompt on iOS 11
The problem is now my users on iOS 10 have a "when in use" option in their settings, which I don't want.
Is there any way to create a version which allows "never" and "always" for iOS 10 and allows all three options on iOS 11?
You are required to include the NSLocationWhenInUseUsageDescription and NSLocationAlwaysAndWhenInUsageDescription keys in your app's Info.plist file. (If your app supports iOS 10 and earlier, the NSLocationAlwaysUsageDescription key is also required.) If those keys are not present, authorization requests fail immediately.
https://developer.apple.com/documentation/corelocation/choosing_the_authorization_level_for_location_services/request_always_authorization#see-also
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With