美文网首页
HealthKit 获取健康数据闪退问题( iOS10以后的隐私

HealthKit 获取健康数据闪退问题( iOS10以后的隐私

作者: 李栖桐 | 来源:发表于2016-11-24 17:02 被阅读1010次

之前开发HealthKit 闪退问题

闪退位置 requestAuthorizationToShareTypes:nil

        [self.healthStore requestAuthorizationToShareTypes:nil readTypes:readDataTypes completion:^(BOOL success, NSError * _Nullable error) {
            if (success) {
                NSLog(@"HealthStore success");
            }
            if (error) {
                NSLog(@"%@", error);
            }
        }];

在iOS10.0版本以前都是没有问题的

查询之后 是因为没有把隐私打开

就是在info.plist 里面添加 隐私允许

<key>Privacy - Health Update Usage Description</key>
<string>health</string>
<key>Privacy - Health Share Usage Description</key>
<string>health</string>

<string>为空 会崩掉
添加以后如下 打出Privacy 会提示
iOS10 之前的 例如 NSPhotoLibraryUsageDescription 会自动补全

privacy.png

升到iOS10之后,关于 info.plist 其他隐私

是否允许此App使用你的xxx?

·


alert.png
  • 健康分享权限:Privacy - Health Share Usage Description
  • 健康更新权限:Privacy - Health Update Usage Description
  • 相机 :Privacy - Camera Usage Description
  • 相册:Privacy - Photo Library Usage Description
  • 摄像头:Privacy - Contacts Usage Description
  • 麦克风:Privacy - Microphone Usage Description
  • 通讯录权限: Privacy - Contacts Usage Description
  • 蓝牙权限:Privacy - Bluetooth Peripheral Usage Description
  • 日历权限:Privacy - Calendars Usage Description
  • 定位权限:Privacy - Location When In Use Usage Description
  • 定位权限: Privacy - Location Always Usage Description
  • 位置权限:Privacy - Location Usage Description
  • Siri使用权限:Privacy - Siri Usage Description
  • 语音转文字权限:Privacy - Speech Recognition Usage Description
  • 媒体库权限:Privacy - Media Library Usage Description
  • 运动使用权限:Privacy - Motion Usage Description
  • 音乐权限:Privacy - Music Usage Description
  • 提醒使用权限:Privacy - Reminders Usage Description
  • 电视供应商使用权限:Privacy - TV Provider Usage Description
  • 视频用户账号使用权限:Privacy - Video Subscriber Account Usage Description

相关文章

网友评论

      本文标题:HealthKit 获取健康数据闪退问题( iOS10以后的隐私

      本文链接:https://www.haomeiwen.com/subject/xgybpttx.html