iOS - 应用程序崩溃,因为它试图在没有使用说明的情况下访问隐私敏感数据

hul*_*alu 2 ios

我收到以下错误:

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

你知道怎么解决这个问题吗?

Mic*_*rre 8

这些是在plist您的项目中设置的.您可以通过导航到目标信息检查器并展开"自定义iOS目标属性"部分来添加/删除这些内容.例如,我的项目中的一个条目是:

Privacy - Camera Usage Description
Allows user to capture a photo or video to upload to their family circle
Run Code Online (Sandbox Code Playgroud)

你可以看到这看起来如何:

项目检查员的例子


Pie*_*rce 3

您需要转到 Info.plist,添加一个新行并将其粘贴NSPhotoLibraryUsageDescription到键列中。然后在值列中描述为什么需要访问用户的照片库。NSCameraUsageDescription如果您打算使用设备的相机,请重复相同的步骤。