Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'NSHealthUpdateUsageDescription must be set in the app's Info.plist in order to request write authorization.'
Info.plist has this entry
<key>NSHealthShareUsageDescription</key>
<string>some string value stating the reason</string>
If you already added NSHealthShareUsageDescription but still get the exception.
It may be due to that the description is too short.
Make sure the description is longer than 12 characters for all locales.
e.g.
HelloHello -> Crash!!
HelloHelloHi -> OK
The error wants NSHealthUpdateUsageDescription
to be set. Those are different keys as you can see here: https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html
NSHealthShareUsageDescription: Specifies a localized string that describes why the app wants to read HealthKit data. See NSHealthShareUsageDescription for details.
NSHealthUpdateUsageDescription: Specifies a localized string that describes why the app wants to write data to the HealthKit store. See NSHealthUpdateUsageDescription for details.
If your app need use HealthKit, you should add read and write privileges in the Info.plist.
Write Privilege:
<key>NSHealthUpdateUsageDescription</key>
<string>some string value stating the reason</string>
Read Privilege:
<key>NSHealthShareUsageDescription</key>
<string>some string value stating the reason</string>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With