This might be a dumb question but on iOS we can specify the reason for accessing user location by including relevant keys in the info.plist file (NSLocationWhenInUseUsageDescription
, NSLocationUsageDescription
or NSLocationAlwaysUsageDescription
).
However, it seems that this cannot be accomplished on a Mac (at least none of those work for me).
Does anyone know how to include this information so that users know for what purpose my app wants to access their location data?
The keys indeed are included in CoreLocation.framework
, and are listed within the Cocoa Keys section of the Information Property List Key Reference:
NSLocationUsageDescription ( iOS 6.0 and later, OS X v10.9 and later )
Specifies the reason for accessing the user’s location information. See NSLocationUsageDescription for details.NSLocationWhenInUseUsageDescription ( iOS 8.0 and later, OS X v10.10 and later )
Specifies the reason for accessing the user’s location information. See NSLocationWhenInUseUsageDescription for details.NSLocationAlwaysUsageDescription ( iOS 8.0 and later, OS X v10.10 and later )
Specifies the reason for accessing the user’s location information. See NSLocationAlwaysUsageDescription for details.
Adding the key NSLocationUsageDescription
to the Info.plist
automatically gets translated into human readable (Privacy - Location Usage Description):
When launching the app I'm presented with the above dialog, which includes the description. It's unclear what exactly you've tried, although from basic testing the functionality seems to work.
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