yaali yaali -3 years ago 267
Swift Question

Not able to add "Privacy - Location Always and When in use usage description" in info.plist - Xcode 9 Beta

I am getting the following error while trying to ask permission from the user for location in Xcode 9 Beta. I tried adding "Privacy - Location When In Use Usage Description" and "Privacy - Location Usage Description" description in info.plist but still getting the same error.


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


When i try to add "Privacy - Location Always and When in use usage description" it is automatically getting renamed to "Privacy - Location Usage Description" in info.plist

Answer Source

Add "NSLocationAlwaysAndWhenInUseUsageDescription" instead of "Privacy - Location Always and When in use usage description". In the current beta it won't get renamed to anything but it shows the correct dialog for iOS 11.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download