我们可以在 info.plist 中为键 NSPhotoLibraryAddUsageDescription 保留空的描述吗?

Can we keep description empty in info.plist for key NSPhotoLibraryAddUsageDescription?

虽然将 NSPhotoLibraryAddUsageDescription 键添加到 info.plist 只是为了避免崩溃问题,但我们可以保留描述为空吗?

因为原生弹窗的描述似乎也是相关信息,所以我不想再添加更多的文字。

Apple 会允许这样做吗?

来自 documentation(强调我的):

Important: To protect user privacy, an iOS app linked on or after iOS 10.0, and that accesses the user’s photo library, must statically declare the intent to do so. Include the NSPhotoLibraryAddUsageDescription key (in apps that link on or after iOS 11) or NSPhotoLibraryUsageDescription key in your app’s Info.plist file and provide a purpose string for the key. If your app attempts to access the user’s photo library without a corresponding purpose string, your app exits.

换句话说,不,您必须说明为什么需要访问照片库。否则,iOS 会终止您的应用程序

使用说明将在 App Permission Alert 中显示为一条消息,每当 Camera/Photo/Contacts 首次使用时,都会向用户显示该消息。

来自iOS 11.x 我们必须提供使用说明。否则 Apple 将拒绝应用程序提交。

这是当您错过使用说明时来自 Apple 的消息: "Missing Info.plist key - This app attempts 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."