引言
iOS 10的一大变化是更强的隐私数据保护。在文档中是这么描述的:You must statically declare your app’s intended use of protected data classes by including the appropriate purpose string keys in your Info.plist file.
简单的说访问用户数据都需要现在Info.plist中声明,否则会crash,这些用户数据包括:
Contacts(联系人), Calendar(日历), Reminders(提醒), Photos(照片), Bluetooth Sharing(蓝牙), Microphone(麦克风), Camera(相机), Location(地理位置), Health(健康), HomeKit(家庭套件), Media Library(媒体图书馆), Motion(运动), CallKit, Speech Recognition(语音识别), SiriKit, TV Provider(电视提供商).
- 以下是开发常用的隐私权限声明
1.相册,相机
Privacy - Photo Library Usage Description //相册
Privacy - Camera Usage Description //相机
2.麦克风,通讯录
Privacy - Microphone Usage Description //麦克风
Privacy - Contacts Usage Description //通讯录
3.定位
Privacy - Location Always Usage Description //持续定位
Privacy - Location When In Use Usage Description //使用应用时定位