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

109,140

Solution 1

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

Solution 2

EDIT April 2019 : You now have to add these two keys, as spring 2019 has begun. Note that NSLocationAlwaysUsageDescription is now deprecated (since iOS 11) and has been replaced with NSLocationAlwaysAndWhenInUseUsageDescription and NSLocationWhenInUseUsageDescription. If you want to support lower than iOS 11, you'll have to use the three values.

To sum up you have to:

  • Add NSLocationAlwaysAndWhenInUseUsageDescription AND NSLocationWhenInUseUsageDescription for iOS 11 and more
  • And add NSLocationAlwaysUsageDescription if you want to support iOS 10 and less
  • And finally, you can add NSLocationUsageDescription if you wan to support iOS 8 and less.


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...).

Solution 3

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.

Solution 4

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.

enter image description here

Solution 5

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.

  1. Open info.plist as source code.
  2. 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>
    
Share:
109,140

Related videos on Youtube

John doe
Author by

John doe

Updated on July 08, 2022

Comments

  • John doe
    John doe almost 2 years

    I've submitted my app for review to the App Store 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?

    • huong
      huong over 5 years
      I'm having the same issue with the latest build, given that I don't even use Location Services in my app. And Apple has no official document about this change.
    • Jamie
      Jamie over 5 years
      Same issue here, not changed the Info.plist either
    • fphilipe
      fphilipe over 5 years
      Same issue. I just did a tiny change and a new build and got this. I do have an NSLocationWhenInUseUsageDescription in the Info.plist that is blank but I have translation strings for it.
    • Tiago Ornelas
      Tiago Ornelas over 5 years
      +1 Did a release for the same app 2 days ago and everything is fine. 2 days later, just changed a couple of lines of code to do a new release (didn't add more Pods or something like that) and I got this message
    • AMB
      AMB over 5 years
      We've experienced the same issue. I suspect it's a bug in the approval process (hopefully). I'm going to ignore for the weekend and hope that it's fixed on Monday.
    • ilight
      ilight over 5 years
      I faced the same exact issue just now although our App doesn't really need Location Services Always. It just needs NSLocationWhenInUseUsageDescription which we already have a purpose string for. Probably this is just a glitch on Apple's end?
    • gwalshington
      gwalshington over 5 years
      And in Apple-fashion, the link they provide in the email to fix it, is broken.
    • Bishoy Hanna
      Bishoy Hanna about 5 years
      Do we have to re-archive after updating the info.plist ?
    • Ragesh Pikalmunde
      Ragesh Pikalmunde over 4 years
      I also got the same issue. I installed ionic diagnostic plugin and got this NSBluetoothAlwaysUsageDescription in the Info.plist
  • Cameron A. Ellis
    Cameron A. Ellis over 5 years
    Wow, I just got this, realized everyone is just getting this too!
  • Juan José Ramírez
    Juan José Ramírez over 5 years
    In other app update, Apple requested this permission too: "Privacy - Location Always Usage Description"
  • Mayoul
    Mayoul over 5 years
    It's just stupid.... If I'm not using it, it could make peoples dont downloading my app just because of that. -_-
  • sebleclerc
    sebleclerc over 5 years
    Not really. The alert asking you to use your localization won't show unless somewhere in the code the CLLocationManager.requestWhenInUseAuthorization() is called. Apple analyzed each app code to see if such a function could be called. If it's never called, the alert won't show up.
  • Lookaji
    Lookaji over 5 years
    Actually it is NOT "some message to appease Apple" but to let the user know WHAT are you doing with the user's generated data (location) in this case. It is a matter of privacy concerns and I do think it is good to be fair to your apps users.
  • Lookaji
    Lookaji over 5 years
    Gotcha! I was thinking to newbies that may be tempted to leave it so! I did not want to sound grumpy :) cheers!
  • Steve
    Steve about 5 years
    More of a comment really...?
  • Hudi Ilfeld
    Hudi Ilfeld about 5 years
    first key has changed as of now to <key>NSLocationUsageDescription</key>
  • innich
    innich about 5 years
    I had to remove extra spaces in <key> tags and then it worked.
  • Sachin Nautiyal
    Sachin Nautiyal about 5 years
    @innich thank you for pointing it out, I have changed my answer.
  • Bishoy Hanna
    Bishoy Hanna about 5 years
    Do we have to re-archive after updating the info.plist ?
  • Heemanshu Bhalla
    Heemanshu Bhalla about 5 years
    @gwalshington I don't have any expo object in app.json
  • gwalshington
    gwalshington about 5 years
    @HeemanshuBhalla hmm, i'm unsure why. In my app.json, it's at the top and the first object declared. It's where you declare the version number, bundle identifier, etc. If you have ejected the app, maybe it looks slightly different?
  • Ruslan Shashkov
    Ruslan Shashkov about 5 years
    So if I don't use these features, what I have to write there, a lie, something like "collect location for future use, maybe"?
  • c0dehunter
    c0dehunter about 5 years
    What text to type if we don't collect and Location data? We need to make up a lie :S
  • gwalshington
    gwalshington almost 5 years
    @PrimožKralj Yes unfortunately - I don't collect location data, but it forced me to provide a message.
  • apricity
    apricity almost 5 years
    In your April 2019 edit, are you sure you don't have the deprecation reversed? From what I see NSLocationUsageDescription is the one that's deprecated. Looking here: developer.apple.com/library/archive/documentation/General/…
  • Juan José Ramírez
    Juan José Ramírez almost 5 years
    yes, apple will reach to you if they have questions
  • Dror Bar
    Dror Bar almost 5 years
    Do I have to increase the bundle version or version number to upload a new binary?
  • Dror Bar
    Dror Bar almost 5 years
    The email I received from apple mentions NSLocationAlwaysUsageDescription so i think he has it reversed.
  • AnthoPak
    AnthoPak almost 5 years
    @apricity @DrorBar Sorry guys, indeed I had made a mistake. It was not reversed but there was still a mistake, NSLocationAlwaysUsageDescription should be replaced by NSLocationAlwaysAndWhenInUseUsageDescription and NSLocationWhenInUseUsageDescription , and not by NSLocationUsageDescription (as I previously wrote, sorry…). I've updated my answer to add a sum up of the process.
  • Muhammad Awais
    Muhammad Awais over 4 years
    I am not able to find Information Property List in my xcode 10.1, you should have mentioned where to find it, I have looked for Build Settings both for Targets and Project
  • Muhammad Awais
    Muhammad Awais over 4 years
    Okay So Targets->Info->Custom ios Target Properties was the exact location
  • Danh Huynh
    Danh Huynh over 4 years
    Yes, it’s a bug!
  • MaylorTaylor
    MaylorTaylor over 4 years
    This helped me. If you are using Location in your app (or maybe just always) you need to add this line and a string below it. <key>NSLocationAlwaysUsageDescription</key> <string>Always And In Use Permission</string>
  • Kapil Soni
    Kapil Soni about 4 years
    sir i got same error but why add to info.plist actually i m not used contact feature in my app so why we need to add it?
  • dbrownjave
    dbrownjave about 4 years
    @Kapilsoni Please ensure you are not accessing one or more APIs that has access to sensitive user data
  • Kapil Soni
    Kapil Soni about 4 years
    :sir I have used only camera and location in my app?
  • Fotios Tsakiris
    Fotios Tsakiris over 2 years
    @BishoyHanna YES! Dror Bar YES!