iOS 11 Location not working - ios

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.

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>

Related

ITMS-90683: Missing Purpose String in Info.plist

Deploying the app on testFlight I'm having the following issue,
The app's Info.plist file should contain a
NSLocationAlwaysUsageDescription key with a user-facing purpose string
explaining clearly and completely why your app needs the data.
Even if I have include on the Info.plist file the keys needed for the location access.
The app is submitted for review and tests but I'm still getting an email on every submit that says:
Version: 1.0.2 Build: 74) has one or more issues
I've checked the solution here in order to add the deprecated keys too
Error Appstore connect : Missing Purpose String in Info.plist File
Sorry, perhaps I'm missing something here?
Right click on your Info.plist file. then click on 'Open As' -> 'Source Code'.
Now find and replace below keys,
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>your description.</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>your description</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>your description.</string>
Property list view of your info.plist is not showing like
Privacy - Location always and when In Use Usage Description
Privacy - Location always Usage Description
Instead it is showing NSLocationAlwaysAndWhenInUseUsageDescription and NSLocationAlwaysUsageDescription

Rejected react native iOS app due to Missing Purpose String in Info.plist File from appstore

I got the following mail from appstore due to missing purpose string in info.plist file.
This is a React Native application that supports both iOS and Android.
My app is not requesting access to the user's calendar.
I thought the description only was mandatory if you actually requested a permission, or are these descriptions mandatory even if I never request to see the users calendar.
Missing Purpose String in Info.plist File - Your app's code references one or more APIs that access sensitive user data. The app's Info.plist file should contain a NSCalendarsUsageDescription 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 access user data will be required to include a purpose string.If you're using external libraries or SDKs, they may reference APIs that require a purpose string. While your app might not use these APIs, a purpose string is still required. You can contact the developer of the library or SDK and request they release a version of their code that doesn't contain the APIs. Learn more (https://developer.apple.com/documentation/uikit/core_app/protecting_the_user_s_privacy).
Sometimes, packages you install will reference APIs that you don't really need. For example, react-native-permissions does this, and you must add a usage description for all the APIs they use.
The react-native-permissions package explains this here: https://github.com/yonahforst/react-native-permissions#app-store-submission-disclaimer
If you need to submit you application to the AppStore, you need to add to your Info.plist all *UsageDescription keys with a string value explaining to the user how the app uses this data. Even if you don't use them.
And this is an example of how your Info.plist file should look like:
<key>NSBluetoothPeripheralUsageDescription</key>
<string>Some description</string>
<key>NSCalendarsUsageDescription</key>
<string>Some description</string>
<key>NSCameraUsageDescription</key>
<string>Some description</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Some description</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>Some description</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Some description</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Some description</string>
<key>NSSpeechRecognitionUsageDescription</key>
<string>Some description</string>
<key>NSAppleMusicUsageDescription</key>
<string>Some description</string>
<key>NSMotionUsageDescription</key>
<string>Some description</string>

Xcode - Missing Purpose String in Info.plist File

I am trying to upload a new version of my app to iTunes Connect from Xcode.
I keep getting an email saying my app's "Info.plist file should contain a NSCalendarsUsageDescription key"
I have already added these strings to my Info.plist:
<key>NSMicrophoneUsageDescription</key>
<string>microphone use</string>
<key>NSCalendarsUsageDescription</key>
<string>calendar use</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>photo and video use.</string>
But, I still get the email that my Info.plist is missing the NSCalendarsUsageDescription key
Is there something else I need to add? Apple's website says I need to "Use the specified APIs to request authorization to use the data or resource." I am new to coding and don't know what this means!
https://developer.apple.com/documentation/uikit/core_app/protecting_the_user_s_privacy
It is not enough to write "calendar use". The app's Info.plist must contain an NSCalendarsUsageDescription key with a string value explaining to the user how the app uses this data. So provide a better explanation of why your app needs to access this data.
I solved this problem by adding the Usage Description Strings to the "Custom iOS Target Properties" rather than only adding them to my info.Plist

Xcode 9 - Warning on Location usage Description in Info.plist - iOS 11

I've just updated to Xcode 9.0 official version and when I run my app which uses Location service, it works fine but the console prints the following warning:
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
So I've tried to add the following key in my Info.plist:
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>This app needs your current location</string>
But when I try to run the app again Xcode 9 shows an alert that says: The data couldn’t be read because it isn’t in the correct format.
So I switched back to:
<key>NSLocationAlwaysUsageDescription</key>
And the app works fine. Oh, and my Info.plist already contains the NSLocationWhenInUseUsageDescription key!
Is that a Xcode 9 bug in the console? Is anyone getting the same warning?
Nevermind, I've fixed it by simply browsing and selecting the right Privacy - Location usage options in Info.plist -> Open As -> Property List view, here's the right keys to insert into Info.plist in case you need it:
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>This app needs your current location</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>This app needs your current location</string>

iOS10 app has crashed because it attempted to access privacy-sensitive data

My app crashed when I try to open video camera. It is fine when it opens the camera, but when I switch from image to video I get this error:
[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 NSMicrophoneUsageDescription key with a string value explaining to the user how the app uses this data.
I find this weird because I have added the permission in my plist file.
<key>NSCameraUsageDescription</key>
<string>Camera is used to make pictures when creating a job</string>
In your .plist add this key: Privacy - Microphone Usage Description and your desired value.

Resources