I have an iOS app that uses the Google maps library which I have added via CocoaPods. This app fetches user location even in background so it asks the user for NSLocationAlwaysUsageDescription.
But upon running the app from Xcode, I get the correct permission alert but I also get the following error message in the console.
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
Doesn't NSLocationAlwaysUsageDescription automatically allow when in usage as well? Because I don't want the When In Use option to be available in the Settings because if the user later changes to that, it will cause the app to behave not as intended.
You have to add a key value pair of NSLocationAlwaysUsageDescription as key and value is like you have to notify user , or something else that user can understand that this app is going to use gps location.
You can try this or add this in your plist
Privacy - Location Always Usage Description as key and
Application would like to use your location. By allowing background locations, we can notify you when a customer is requesting for service. Continued use of GPS running in the background can dramatically decrease battery life as value
Related
I have a flutter app, all I am doing is getting the user's current location. That's pretty simple by asking location permission with NSLocationWhenInUseUsageDescription NSLocationAlwaysUsageDescription
But when I run the app, it crashes for missing key NSUserTrackingUsageDescription. When I added that Tracking Usage key now the app store is asking for which data I track (before submission), look at the error
Your app contains NSUserTrackingUsageDescription, indicating that you will request permission to track users. To update this information on your app's product page, you must indicate which data types are tracking users. If this is incorrect, update your app binary and upload a new build to App Store Connect.
I need a location for address only when I provide that information, the continue button is still disabled. This app was published before 2-3 times but now I am having this issue. Now I am updating the App Privacy section about data but it seems the continue button is still disabled for me. I attached the screenshots.
Same issue was encountered in this SO post. I suggest to follow the same workaround here:
To address this issue go to App Store Connect > App Privacy:
1- under Data Types > Location > I selected Precise Location >
Next > Save
2-under the gray Location/Precise Location Section (pictured below)
press the blue Edit Button and tick these 3 selections:
• Used for App Functionality
• Linked to the user's identity
• Used for tracking purposes this is the last option, you must
tick Yes, we use precise location data for tracking purposes. This
will make the error go away
Now the Location section it looks likes this and the error went away
I am using Google Maps in my app, and I tried to deploy the app to iTunes Connect but I received an email stating
"ITMS-90683: Missing Purpose String in Info.plist - Your app's code references one or more APIs that access sensitive user data. The app's Info.plist file should contain an NSLocationWhenInUseUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. Starting Spring 2019, all apps submitted to the App Store that.."
My problem is, that I do NOT request the user's current location in the app but yet I still got this email. Is there a way to solve this?
I'm trying to access the last photo from the user's camera roll within an iOS keyboard extension. I have allowed full access to the keyboard and allowed access to the Photo Library. But every time I try to run PHImageManager.default().requestImage... the keyboard is terminated...
Is it not possible to use PHImageManager in a keyboard extension?
According to App Extension Programming Guide it should be possible.
If you request open access by setting this key’s value to YES, your keyboard gains the following capabilities, each with a concomitant responsibility in terms of user trust:
Access to Location Services, the Address Book database, and the Camera Roll, each requiring user permission on first access
only allowing full access in the info.plist file is not enough, also the user has to allow full access in the keyboards settings.
On your device go to Settings -> General -> Keyboard -> Keyboards -> %NAME_OF_YOUR_KEYBOARD% and turn on Allow Full Access!
But I'm still facing problems here: although i have added a NSPhotoLibraryUsageDescription to my extensions info.plist
my keyboard terminates with following message:
[access] This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data.
I am new to iOS. Is it possible to show a custom view or dialog in place of the default iOS location permission dialog?
No, this dialog is presented by the operating system and you cannot modify it. It is an important part of privacy management that the dialog is presented in a consistent way for all apps and that apps cannot modify the permission process.
You can display a custom view or alert prior to requesting permissions that explains what is happening and the need to click "allow" on the alert that is about to be presented
Direct Answer is it's not possible
explanation :
Only option is set description string by using Cocoa Keys(The keys associated with the Cocoa touch environments)
Add one of these key to
NSLocationWhenInUseUsageDescription
NSLocationAlwaysUsageDescription
Info.plist and set it's value to whatever which describe the purpose of getting location
ex:
MyApp picks you up from where you are. To book airport rides, choose “Allow” so the app can find your location.
Important: To protect user privacy, an iOS app linked on or after iOS 10.0, and which accesses the user’s location information, must statically declare the intent to do so. Include the NSLocationAlwaysUsageDescription key in your app’s Info.plist file and provide a purpose string for this key. If your app attempts to access the user’s location information without a corresponding purpose string, your app exits.
If you looking for localization for that message
Link
One of the frameworks I used (Indoo.rs SDK,for bluetooth location detection) was developed to work with NSLocationWhenInUseUsageDescription in the plist file. I am also using Core Location manager which is configured to work with NSLocationAlwaysUsageDescription.
Can I use both in my .plist? I am not sure how to proceed with this when there are two types of hardware (bluetooth & GPS/WIFI/Celltowers) used for location services.
if you provide two options in your plist file, you will see 3 entries for location in app settings: Always, When In Use and Never, if you provide NSLocationAlwaysUsageDescription only in plist, you will see two entries in the settings: Always & Never and if you provide NSLocationWhenInUseUsageDescription only in plist, you will see two entries in the settings: When In Use & Never
It isn't to do with the hardware that you are using - it is to do with whether you want to use location servers only when your app is running in the foreground (when in use authorisation) or also when your app is in the background (always authorisation).
You should then request the appropriate level of access. "Always" authorisation includes "when in use" authorisation, so if you prompt the user for "always" authorisation then they won't be prompted if the framework requests "when in use" authorisation.
If, however, the framework requests "when in use" before your code requests "always" then the user will see two requests and you will need to set both keys - From a user experience point of view you should avoid this.
Basically you can use only the NSLocationAlwaysUsageDescription in your .plist because if you ask for permission to use the user's location always, you can of course use it also while the app is in use.
These are just settings. Think of how your app is going to work and choose the appropriate permission. "Always permission" means that your app can update its location even if not running (which also drains battery much faster and leaves the location icon on the status bar on all the time and is far more common to get turned off by the user manually later). So choose what your app really needs.
Having the two options both listed gives the user more control over its privacy. The user can decide to only allow locations when the app is open but deny background locations.
NSLocationAlwaysUsageDescription is deprecated.
Apple reference