Error Appstore connect : Missing Purpose String in Info.plist File

I've submitted my app for review to the Appstore connect. Although the app is still under review, i've received an email to inform me that i have to fix an error. Here is the content of the message :

Dear Developer,

We identified one or more issues with a recent delivery for your
app XXXXX. Your delivery was successful, but you
may wish to correct the following issues in your next delivery:

"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
NSLocationAlwaysUsageDescription 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.


After you’ve corrected the issues, you can use Xcode or
Application Loader to upload a new binary to iTunes Connect.

Best regards,

The App Store Team


My app is fully built with expo and i don't know how to access and modify the Info.plist.

Any idea ?

If you're using Expo, you can add solve by adding infoPlist to app.json like so:

"expo": {
"ios": {
"bundleIdentifier": "com.app.myapp",
"infoPlist": {
"NSLocationAlwaysUsageDescription": "Some message to appease Apple.",
},
},
}


Expo Docs

I have some apps in the store and I tried to distribute a version for QA and the same thing happened in two different Apps.
I think this is a new criteria to accept the builds uploads to Appstore connect.

The solution is simple, add the following lines in the .plist file.

<key>NSLocationAlwaysUsageDescription</key>

<string>custom message</string>

<key>NSLocationWhenInUseUsageDescription</key>

<string>custom message</string>

PS: In my case have not using any feature of location, but I added these lines in order to comply with Appstore connect guidelines. Btw after receive that email, I could test the app even when they said that build it had some issues.

I hope this work for you guys.

You can submit your app even if you got this message !

I’ve just faced the same issue yesterday, even if the app isn’t using the location functionality. It may be related to some framework included in the project that have this optional feature.

I can confirm that my app has been approved even without the NSLocationAlwaysUsageDescription and NSLocationWhenInUseUsageDescription key in info.plist

Indeed, as Apple stated in the mail :


Starting spring 2019, all apps submitted to the App Store
that access user data will be required to include a purpose
string.


So the only thing to do is to add this key (right now is better, so that you won’t forget) in you project so that it will be included in your next update.

Just add two new entries in your info.plist, with NSLocationAlwaysUsageDescription and NSLocationWhenInUseUsageDescription as keys and a short description of why you use them as the value (even if you don’t really use them...).

##Use this key in info.plist file

NSLocationAlwaysUsageDescription
Your location is required for xyz benefits for you NSLocationWhenInUseUsageDescription
Your location is required for xyz benefits for you

We did receive the same email and we aren't using the CoreLocation at all. After a quick search, we found that Parse SDK could use CoreLocation. In Apple's email, they clearly say:

If you're using external libraries or SDKs, they may reference APIs that require a purpose string.

That mean the minute your code or any other Library or SDKs can use CoreLocation, even if you don't use it, you need to provide privacy description for When In Use and Alway Use.

It is also something new from Apple and for now it's only a warning but it will be required starting in Spring 2019 for new submissions.

This issue is occurring because you haven't included

<NSLocationAlwaysUsageDescription>


for your app. I faced the same issue when I tried to submit my app on the AppStore. After the app was processed, I got the same mail. I just added the description and now its resolved.

Hope this helps.

so now we have 4 cases..

NSLocationAlwaysAndWhenInUseUsageDescription (iOS>11)
NSLocationWhenInUseUsageDescription (iOS>11)
NSLocationAlwaysUsageDescription (iOS<=10)
NSLocationUsageDescription (seems very old, iOS8?)


Apple states at:

"Add the NSLocationWhenInUseUsageDescription key and the NSLocationAlwaysAndWhenInUseUsageDescription key to your Info.plist file."


And:

"If your app supports iOS 10 and earlier, add the NSLocationAlwaysUsage"


NSLocationUsageDescription seems dead, the only ref in ADC site is:
"https://developer.apple.com/ibeacon/Getting-Started-with-iBeacon.pdf"

So to be sure, use first 3.

These answers all tell you how to comply with the App Store rules to avoid the warning but the true fix would be for Expo to allow you to disable their SDKs requirement for Location Services unless you actually use them - I'm not sure if this is possible.

It's a new requirement from apple, even if you do not use location. If you want to add the permissions in Xcode, look for "Privacy - Location Usage Description" and "Privacy - Location When In Use Usage Description" and type a custom string for each of them.



My app also got that, and I do nothing about it but it can run well ,next time I think should add such key in plist,just do some description

For more simplifying you can add these lines in your info.plist. These error are coming because Starting spring 2019, all apps submitted to the App Store that access user data will be required to include a purpose string.


Open info.plist as source code.
Add these following lines in your plist

<key> NSLocationAlwaysAndWhenInUseUsageDescription </key>
<string> $(PRODUCT_NAME) needs Location access for "some reason"! </string>
<key> NSLocationWhenInUseUsageDescription </key>
<string>$(PRODUCT_NAME) needs Location access for "some reason"! </string>
<key> NSLocationAlwaysUsageDescription </key>
<string>$(PRODUCT_NAME) needs Location access for "some reason"! </string>

Comments

Popular posts from this blog

Meaning of `{}` for return expression

Get current scroll position of ScrollView in React Native

flutter websocket connection issue