今天做使用的相机,发现Crash了,原因是ios10以后,苹果对权限看管的更严了,
This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSContactsUsageDescription key with a string value explaining to the user how the app uses this data.
意思是说:你需要在info.plist文件 添加一个“NSContactsUsageDescription ”的Key,Value添加一个描述。
1,在项目中找到info.plist文件,右击有个 Open As,以Source Code 的形式打开
2,下面是各种权限的key,Key 一定不能错,Value 可以随便填写
访问蓝牙
NSBluetoothPeripheralUsageDescription
访问日历
NSCalendarsUsageDescription
相机
NSCameraUsageDescription
相册
NSPhotoLibraryUsageDescription
通讯录
NSContactsUsageDescription
始终访问位置
NSLocationAlwaysUsageDescription
位置
NSLocationUsageDescription
在使用期间访问位置
NSLocationWhenInUseUsageDescription
麦克风
NSMicrophoneUsageDescription
访问媒体资料库
NSAppleMusicUsageDescription
访问健康分享
NSHealthShareUsageDescription
访问健康更新
NSHealthUpdateUsageDescription
访问运动与健身
NSMotionUsageDescription
访问提醒事项
NSRemindersUsageDescription
3,Clean之后,运行就OK了