Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NSLocationWhenInUseUsageDescription warning, but I have already added it

While I have already added:

NSLocationWhenInUseUsageDescription

I keep receiving this warning:

This app has attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSLocationWhenInUseUsageDescription key with a string value explaining to the user how the app uses this data

FYI: I have multiple Info.plist in the app. Not sure what to do.

like image 751
Mohamed Avatar asked Sep 13 '17 09:09

Mohamed


People also ask

What is NSLocationWhenInUseUsageDescription?

NSLocationWhenInUseUsageDescription. A message that tells the user why the app is requesting access to the user's location information while the app is running in the foreground.

What is info plist in Xcode?

Xcode supplies an information property list file when you create a project from a template, as described in Create a project. By default, Xcode names this file Info. plist and adds it to your project as a source file that you can edit. Xcode creates one information property list for each target in the project folder.


2 Answers

Adding both

NSLocationAlwaysAndWhenInUseUsageDescription

and

NSLocationWhenInUseUsageDescription

keys in plist solved my problem.

    <key>NSLocationAlwaysUsageDescription</key>
    <string>Your location is required for xyz benefits for you</string>
    <key>NSLocationWhenInUseUsageDescription</key>
    <string>Your location is required for xyz benefits for you</string>
like image 155
Kartihkraj Duraisamy Avatar answered Oct 16 '22 21:10

Kartihkraj Duraisamy


There are a ton of poorly structured frameworks (namely FirebaseMessaging) that use camera and location for no benefit to the user. You should alert end user this functionality is NOT needed for your application and user must NOT grant app access to that parasite inside. What a sad, sad times we live in.

    <key>NSLocationAlwaysUsageDescription</key>
    <string>Your location is not needed. This request has popped up due to a 3rd party framework used by the app in a context that does NOT need you to reveal you location. Do be sure to check audit trail for the location queries on ios 15 or later.</string>
    <key>NSLocationWhenInUseUsageDescription</key>
    <string>You will get zero benefit allowing this app accessing your location. You should never see this alert. If you do alert technical support at [email protected]</string>

Or otherwise do be crafty in the verbiage used to convey the exact usage and risks giving app access to anything outside its sandbox and edufy thy user on the audit trail for the permissions given that has to be examined from time to time (like anyone's gonna do that). Thankfully, lately (circa ios14), Apple reports to the end user suspicious activity such as MapsMe tracking in the background all the time.

like image 24
Anton Tropashko Avatar answered Oct 16 '22 21:10

Anton Tropashko