Getting Missing Purpose String in Info.plist

Hello,


I keep getting an email from App Store Connect stating that my app's bundle is invalid because of "ITMS-90683: Missing Purpose String in Info.plist" It is stating that I need to add NSHealthShareUsageDescription to the bundle. However, when I add NSHealthShareUsageDescription to Info.plist I get "ERROR ITMS-90363: "Invalid Info.plist Key." Stating that NSHealthShareUsageDescription is invalid from Xcode. Any ideas on how to solve this problem?

Replies

What version Xcode are you using?


Can you describe the process used to add that key, thanks.


AFAIK, you need to add two descriptions NSHealthUpdateUsageDescription and NSHealthShareUsageDescription, being sure of course to give each of them a brief and logical description.


Be sure to also localize as needed.

Having the same problem. Can't figure out why the key NSHealthShareUsageDescription is invalid...

Someone else figured this out. In a nutshell, you need a second, redundant Info.plist containing the privacy notices in the overall app container target (as well as the app extension). I failed a few times even with this information, and ended up created a separate folder for the new Info.plist file, and named it exactly "Info.plist", then it worked.


https://learningswift.brightdigit.com/independent-watch-app-healthkit-permissions/

Step by Step Solution – 
 
I appreciate all the replies to this question, it took me a while, but I also figured it out. I thought I would write a reply with a step by step for all the casual developer like me. 
 
I made an Apple Watch only app that incorporates the health kit and just like Apple demonstrates I included the info.plist user facing string describing what I will be doing with the information, just displaying it while the workout is active and saving the workout data once concluded. This resulted in getting the errors from apple upon uploading, and 14 builds later I finally got it to work!
 
Here is how I did it, following the other answers on this page (I definitely didn’t figure it out on my own – Thank you so much everyone!)
 
Step 1. Make sure you have both “Privacy – Health Share Usage Description” and “Privacy – Health Update Usage Description” in the [Your App] Watchkit Extension, Info.plist. This is the one that Apple shows in their videos and documentation. (assuming that’s what you’re using, if you have other permissions, maybe it will work the same way and just include the ones you need)
 
Step 2. Make a new folder in the finder on the left side of xcode – this is easier to do inside the [Your App] Watchkit Extension, and then drag it to be on the same level as the [Your App] Watchkit Extension. Name this folder [Your App]. 
          
Now you have a project (Your app) at the top with the folders, [Your App] (The new one you made), [Your App] Watchkit App, [Your App] Watchkit Extension, Products and frameworks. (Maybe a few more based on your own app, but that’s the basics.  
 
Step 3. Right click the newly created [your app] folder, click “new file”, in the template menu find “Property list” under “Resources” options and click it. Do not give it a target! Keep those blank. Do this when adding it by deselecting all the targets. Once created confirm there are no targets by clicking it and with the far right “Inspector Window” open look at “Target Membership” none of them should have a check mark. In the same “Inspector Window” rename it “Info.plist”.
 
Step 4. Right click on the new “Info.plist” and “open as” -> “Source Code”. 
 
Step 5. It seems that it doesn’t automatically show you the options to include things like “ Privacy - …” when you start typing so the easiest thing for me was just to paste the code provided in another answer which was :
 
Code Block <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>NSHealthShareUsageDescription</key>
  <string> YOUR DESCRIPTION HERE </string>
  <key>NSHealthUpdateUsageDescription</key>
  <string> YOUR DESCRIPTION HERE </string>
</dict>
</plist>

Change the “Your description here” parts up in the code so that it is the same as your [your app] watchkit extension, plist, strings. Per Apples request, just write in clear language why you want access to it. 

Step 6. In the far left “Navigator Window” Click on (Your App) Project, the main one at the top all the folders are in that is an “xcodeproj” file, that should bring up your info – settings screen in the main editor (Center) part of xcode. Make sure you choose your project and not the targets on the left side of the main editor part. This is where it’s hard to describe for a casual coder like me. It’s in the same area where you put the version and build numbers, but the project is selected and not the targets.

Step 7. Choose “Build Settings” at the top center and scroll down until you see “Packaging” Then look for “info.plist File”. Click on the column that has “[your app]” at the top so you can bring up the window where you can edit. It’s just a large square window but that’s where it goes. Include the link to the new plist you made by typing “[your app]/Info.plist. I did this for both the release and debugging so they are the same and it makes one row. 

Step 8. Clean your build folder with the hotkeys or just go to “Product” -> “Clean Build Folder”

Step 9. Test your app, it should work, it worked for me. Upload your app… it also should work. I was afraid I’d get yet another email from apple telling me about my “invalid” binary… but not this time! This time it worked. 

Thank you for everyone that replied to this question. I took all your answers and bundled them into one big step by step made for people as inexperienced as me. There is one more reply that talked about going into the archive file and changing it by hand… that was going to be my final try but I didn’t have to do it with these steps. If you’re still having trouble maybe that would be your answer.
  • Peter

  • Thank you for your solution. It worked!

Add a Comment
Is there an update on this matter? I'm entirely new to iOS/watchOS development and this bit me as well on my standalone watchOS app. I started from the Xcode generated project template so I kinda expected this to work. I also used the Info.plist as documented by Apple themselves. The solution above and in the linked blog post worked perfectly fine, so thanks for that. But it feels wrong to have two separate files containing the same information.
In my case I had an App Clip referencing a framework which references HealthKit. While the App Clip target had nothing to do with any HealthKit class, I had to add NSHealthShareUsageDescription and NSHealthUpdateUsageDescription to the App Clip's Info.plist to make it work.

I had TMS-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 a NSHealthShareUsageDescription key 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 a NSHealthUpdateUsageDescription key 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 a NSLocationWhenInUseUsageDescription key

For me how I fixed it was I thought if each of the key's were necessary including these but I had more for things health and location related. Turns out I didn't need a key that was Privacy - Location Always Usage Description, I found any code related to requesting always access to it and deleted it. I resubmitted my app without changing anything regarding the above except for deleting the Location Always Usage Description key. So I'm not convinced that the error had to do with what it said it did.

How do i fix

 Dear Developer, We identified one or more issues with a recent delivery for your app, "UpLove" 2.42 (28). Your delivery was successful, but you may wish to correct the following issues in your next delivery: 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 a 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 access user data are 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