iOS 10 升级后,坑还是挺多的,之前写的项目中照片访问就crash掉了
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 文件添加一个 NSPhotoLibraryUsageDescription的
key,然后添加一个描述。
下面是我对相册和相机添加的两条描述
下面是其他关于隐私添加有关权限问题的key
相机:<key>NSCameraUsageDescription</key>
<string>cameraDesciption</string>
联系人:<key>NSContactsUsageDescription</key>
<string>contactsDesciption</string>
麦克风:<key>NSMicrophoneUsageDescription</key>
<string>microphoneDesciption</string>
相册:<key>NSPhotoLibraryUsageDescription</key>
<string>photoLibraryDesciption</string>
其中这个string值可以随意写
本文介绍了解决iOS10升级后应用尝试访问敏感数据导致崩溃的问题。通过在Info.plist文件中添加NSPhotoLibraryUsageDescription键及描述来解决相册访问权限问题,并列举了其他隐私相关权限设置。
3633

被折叠的 条评论
为什么被折叠?



