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