1

I have now added all of these 4 related to Location:

NSLocationWhenInUseUsageDescription NSLocationUsageDescription NSLocationAlwaysUsageDescription NSLocationAlwaysAndWhenInUseUsageDescription

BUT still I get this in console: 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

And the app don't gets location.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Somal
  • 128
  • 10
  • did you put any description for the values? – Andrea Miotto Nov 01 '17 at 14:13
  • Please share the relevant xml entries in your plist (right click -> Open as source code). – oyvindhauge Nov 01 '17 at 14:13
  • Possible duplicate of [Location Services not working in iOS 11](https://stackoverflow.com/questions/44424092/location-services-not-working-in-ios-11) – BuLB JoBs Nov 01 '17 at 14:22
  • follow this link similar question here!! :- https://stackoverflow.com/questions/44424092/location-services-not-working-in-ios-11 – BuLB JoBs Nov 01 '17 at 14:22
  • 1
    Check the info file you are editing that, if that info file is the correct one for your target project. – A K M Saleh Sultan Nov 01 '17 at 15:44
  • Thanks @SalehSultan this was my bad, I had multiple targets and multiple info.plist for each, and I missed adding the new iOS11 keys in the info file of target I was running, and added it to other targets's info files instead. Thanks everyone who tried to answer. – Somal Nov 01 '17 at 16:34

1 Answers1

2

open your plist as source code (right click->open source code). Inside the <dict></dict> you must add both the key and a description key like this:

    <key>NSLocationWhenInUseUsageDescription</key>
    <string>The app use your location when in use</string>
    <key>NSLocationAlwaysUsageDescription</key>
    <string>The app use your location always</string>
Andrea Miotto
  • 7,084
  • 8
  • 45
  • 70