如果在app中调用了苹果健康,iOS10中会出现闪退。
报错为:
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文件中声明苹果健康的使用权限,所以要在info.plist中添加以下key。
请求写入
<key>NSHealthUpdateUsageDescription</key><string>some string value stating the reason</string>
请求读取
<key>NSHealthShareUsageDescription</key> <string>some string value stating the reason</string>