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!!

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