程序员人生 网站导航

iOS 解决iOS10相册、相机、麦克风等权限使用问题

栏目:综合技术时间:2016-11-22 08:57:31

访问相册出现下面崩溃提示:

[access] 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.

在Info.plist里面添加1个String字段 NSPhotoLibraryUsageDescription ,Value可随意,它将显示在弹出来的用户权限选择框上。

同理使用相机时候:

[access] This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSCameraUsageDescription key with a string value explaining to the user how the app uses this data.

添加NSCameraUsageDescription字段和value

麦克风:

[access] This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSMicrophoneUsageDescription key with a string value explaining to the user how the app uses this data.

添加NSMicrophoneUsageDescription 和value

其他类似的1样。

------分隔线----------------------------
------分隔线----------------------------

最新技术推荐