How can I upload an independent watchOS application that requires a privacy description in the Info.plist?

Hi,


I created an independent watchOS application (without an iOS counterpart) So I have three targets created by Xcode:


- MyApp (which has no linked folder)

- MyApp WatchKit App

- MyApp WatchKit Extension


No my app requires the use of HealthKit, so I added the `NSHealthShareUsageDescription ` to the Info.plist belonging to the Extension target. But when I try to uploade the application to App Store Connect (through Xcode), I get the following error message:


"Invalid Info.plist key. The key 'NSHealthShareUsageDescription' in bundle MyApp.app/Watch/MyApp WatchKit App.app is invalid."


I tried adding the key to the Info.plist of the App target, but this gave errors after the upload completed...


Anyone tried this before? Maybe this issue is resolved with the new Transporter app, but when this will arrive is a mistery...

Answered by fousa in 382719022

I finally managed to get it working. It turned out the sollution wasn't hard too hard.


I have three targets defined that contain a plist:

  • MyApp
  • MyApp WatchkKit App (with an Info.plist)
  • MyApp WatchkKit Extension (with an Info.plist that contains permission descriptions)


I added an extra Info.plist file that belongs to the 'MyApp' target. This plist only contained the same HealthKit permission descriptions as the 'MyApp WatchkKit Extension'.


<?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>MyApp will use your Health data.</string>
  <key>NSHealthUpdateUsageDescription</key>
  <string>MyApp will save the workout data to Health.</string>
</dict>
</plist>


Hope this helps out someone.

I'm having the same issue, specifically with bringing the HealthKit framework in and I get the same error(s), below. I submitted a bug report for this issue specifically: FB7266383


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 NSHealthShareUsageDescription 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 (https://developer.apple.com/documentation/uikit/core_app/protecting_the_user_s_privacy).

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 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 (https://developer.apple.com/documentation/uikit/core_app/protecting_the_user_s_privacy).

Hi,


Were you able to find any workaround ?

Accepted Answer

I finally managed to get it working. It turned out the sollution wasn't hard too hard.


I have three targets defined that contain a plist:

  • MyApp
  • MyApp WatchkKit App (with an Info.plist)
  • MyApp WatchkKit Extension (with an Info.plist that contains permission descriptions)


I added an extra Info.plist file that belongs to the 'MyApp' target. This plist only contained the same HealthKit permission descriptions as the 'MyApp WatchkKit Extension'.


<?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>MyApp will use your Health data.</string>
  <key>NSHealthUpdateUsageDescription</key>
  <string>MyApp will save the workout data to Health.</string>
</dict>
</plist>


Hope this helps out someone.

Hi,


Where did you place this file as if I place it in any folder Xcode refuses to build and archive?

And the Target "My App" doesn't have any folder nor there is a info tab in the project navigator for that target

Can you explain in more details how did you do that ? If I created Info.plist assigned to top level target Xcode refused to build and archive

True. Here is what I did.


1. I created an Info.plist file for the "My App" target and placed them in a new "My App" folder.

2. In the build settings of the "My App" target I set the INFOPLIST_FILE configuration to "My App/Info.plist".


This way the main target contains the correct keys.


FYI The app got perfectly reviewed by Apple and is not ready to be in the watchOS App Store.

Did you resolve your issue ?

Unfortunately it doesn't work. Xcode build is crashed due to duplicate of Info.plist

You have to make sure each target has it's own plist.

The important thing is not to include the Info.plist as a target but rather in build settings for the App Container set the Info.plist file there. You can readmore in-depth details on setting up Health in an Independent Watch App here.

I would hope this gets fixed some where in the pipeline between the Xcode template and App Store submission because this seems redundunt and a hack quite frankly.

I did the same way. But still not working. Is any other settings need to be change?

I did the same way. But still not working. Is any other settings need to be change??

I also just followed these instructions and I got the same error emails as before. Is there anything that wasn't included here that could make this work?

Are you able to resolve it?

Thank you so much.

This workaround helped me with my WatchOS only app.

I had almost the same error but with Bluetooth.

Creating the folder and the new Info.plist with the same strings as in the extention made the trick.

Really helpful!!

I faced the same problem, followed all the described steps and still not working. Thats because the Info.plist for the App Container was created by XCode every time I archived the build. But when I deactivated automatic creation, it did not take my provided Info.plist file and build was not finished.

So I ended up activating automatic creation again and archived my build. I then searched for my archived build and opened up the Info.plist file under /Products/Applications/Appname in this package. And yes, still no privacy entries in there. I then added the privacy entries by hand, saved and closed the package and finally this archive was accepted by apple without further warnings or errors.


Hope that helps!

In case of my standalone WatchOS app with access to Health Kit this helped (I learned it from the previous posts from fousa):
  1. I added the keys "Privacy - Health Share Usage Description" and "Privacy - Health Update Usage Description" with some text as values in the file Info.plist in the folder [MyApp] WatchKit Extension.

  2. Then I created another folder [MyApp] on the same level as the folder [MyApp] WatchKit Extension.

  3. I copied the Info.plist file from the folder [MyApp] WatchKit Extension to the new folder [MyApp] and deleted all keys except the two mentioned above.

  4. Then under Targets (you get there when you click on your project name in the Project Navigator on the top of the left side in Xcode), I clicked on the first target (MyApp) and under Packaging for the key "Info.plist File" I added the path to the new Info.plist file - [Myapp]/Info.plist

I cleaned the build folder and got an error when I tried to build again (under top menu Product - Build) - some new error:
(error: Multiple commands produce '[...]/Info.plist': [...]

I restarted XCode, cleaned the build folder again and clicked on Build again. This time I was asked if it was ok if something was cleaned and I accepted.

Then it worked.

Note: In the past, I also had the keys mentioned above in the Info.plist file in [MyApp] WatchKit App and as I remember it caused problems. So in that file I do not have these two keys anymore.

For folks who are unable to use the 2nd Info.plist file approach, I managed to upload to AppStore by configuring the Build Settings of the main target (not the watch target). There is an Info.plist Values section in the build settings (Xcode 14) and you can enter your privacy description text there. (no need for extra Info.plist file. Hope this helps.

How can I upload an independent watchOS application that requires a privacy description in the Info.plist?
 
 
Q