HealthKit authorization crashes with unhandled NSException in iOS 10 beta 1 HealthKit authorization crashes with unhandled NSException in iOS 10 beta 1 swift swift

HealthKit authorization crashes with unhandled NSException in iOS 10 beta 1


The message of the exception should give you a hint about what the issue is. Starting in iOS 10, usage strings that describe why your app would like access to the users HealthKit data are required. You can specify them in your app's Info.plist.


From the Apple Documentation:

An iOS app linked on or after iOS 10.0 must include in its Info.plist file the usage description keys for the types of data it needs to access or it will crash. To access and update HealthKit data specifically, it must include theNSHealthShareUsageDescription and NSHealthUpdateUsageDescription keys, respectively.