更新Xcode8以后(iOS10),App使用相机,相册,麦克风,定位等等之类的系统权限时,需要在info.plist中增加相关配置,不然在编译的时候,会闪退...
- 相机NSCameraUsageDescription
- 相册NSPhotoLibraryUsageDescription
- 通讯录NSContactsUsageDescription
- 始终访问位置NSLocationAlwaysUsageDescription
- 位置NSLocationUsageDescription
- 在使用期间访问位置NSLocationWhenInUseUsageDescription
- 麦克风NSMicrophoneUsageDescription
- 访问蓝牙NSBluetoothPeripheralUsageDescription
- 访问日历NSCalendarsUsageDescription
- 访问媒体资料库NSAppleMusicUsageDescription
- 访问健康分享NSHealthShareUsageDescription
- 访问健康更新NSHealthUpdateUsageDescription
- 访问运动与健身NSMotionUsageDescription
- 访问提醒事项NSRemindersUsageDescription
PS:分享一下笔者在开发中遇到的错误:
This app has crashed because it attempted to access privacy-sensitive data without a usage description.
The app's Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaining to
the user how the app uses this data.
- 解决办法:
相机权限
<key>NSCameraUsageDescription<key>
<string>cameraDesciption<string>
相册权限
<key>NSPhotoLibraryUsageDescription<key>
<string>photoLibraryDesciption<string>
网友评论