vaklinzi
vaklinzi

Reputation: 2013

iOS 11 Location permission with three options from the beginning

I am trying to ask for location permission on iOS 11 with React Native. There is a change from Apple coming with iOS 11 where we have a third option for using the location permission only when using the app. Our app is location based and need the user's coordinates even when the app is in the background so I would like the user to have the option to click 'Always' the first time the popup shows up. The problem is that the only popup which shows up is not having the three options (the first image below). The second image for iOS 11 is showing the three options which I am trying to achieve. I have added the new Privacy settings to the Info.plist as shown in the third image.

ios_allow_dialog ios10_vs_ios11 ios_app_property

Upvotes: 1

Views: 1367

Answers (1)

melson.jao
melson.jao

Reputation: 204

With iOS 10, to ask a always permission of location, use the key as NSLocationAlwaysUsageDescription

=> You use the wrong key as NSLocationUsageDescription

With iOS 11, to ask a always permission of location, you need 2 keys as NSLocationWhenInUseUsageDescription and NSLocationAlwaysAndWhenInUseUsageDescription

=> You have done this part.

Upvotes: 1

Related Questions