适配iOS10:如何配置获取隐私数据
2016-09-20 本文已影响0人
快乐的小马农
在 iOS10 当中苹果增强了对用户的安全和隐私,在申请很多私有权限的时候都需要在info.plist
中添加描述,否则的话会 crash
控制台会输出如下的东西:
![](https://img.haomeiwen.com/i2925492/3c001b0763b11ad8.png)
如下:添加对相册的访问
![](https://img.haomeiwen.com/i2925492/a73968e8a4f3e710.png)
常见的 key 值
1.NSPhotoLibraryUsageDescription
相册
2.NSCameraUsageDescription
相机
3.NSMicrophoneUsageDescription
麦克风
4.NSLocationUsageDescription
位置
5.NSLocationWhenInUseUsageDescription
在使用期间访问位
6.NSLocationAlwaysUsageDescription
始终访问位置
7.NSCalendarsUsageDescription
日历
8.NSRemindersUsageDescription
提醒事项
9.NSMotionUsageDescription
运动与健身
10.NSHealthUpdateUsageDescription
健康更新
11.NSHealthShareUsageDescription
健康分享
11.NSBluetoothPeripheralUsageDescription
蓝牙
12.NSAppleMusicUsageDescription
媒体资料库