ITMS-90683:Info.plist NSCameraUsageDescription 中缺少目的字符串

ITMS-90683: Missing Purpose String in Info.plist NSCameraUsageDescription

我在应用商店成功上传了我的应用。

应用商店给我发这样一封电子邮件:

App Store Connect

Dear Developer,

We identified one or more issues with a recent delivery for your app, "Kupona Online" 1.0.2 (1.2). Please correct the following issues, then upload again.

ITMS-90683: Missing Purpose String in Info.plist - Your app's code references one or more APIs that access sensitive user data. The app's Info.plist file should contain a NSCameraUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. Starting Spring 2019, all apps submitted to the App Store that access user data are required to include a purpose string. If you're using external libraries or SDKs, they may reference APIs that require a purpose string. While your app might not use these APIs, a purpose string is still required. You can contact the developer of the library or SDK and request they release a version of their code that doesn't contain the APIs. Learn more (https://developer.apple.com/documentation/uikit/core_app/protecting_the_user_s_privacy).

Best regards,

The App Store Team

为了修复这个错误,我在 Xcode 10.2.1 中输入了 Info.plist,如下所示:

但什么也没发生。 App store 总是给我发送这个错误。

如何修复此错误?

对于 NSCameraUsageDescription,在值列中添加使用相机的确切目的。 例如,

人们说他们被拒绝了,即使他们没有请求使用相机。您必须知道 Apple 会使用他们的静态分析工具扫描您的代码。即使您将此保护在功能标志后面,应用商店审核流程仍然会拒绝您的应用。因为他们不知道您什么时候会打开该功能标志。

此外,如果第三方服务的代码中包含相机访问相关代码,您可能会遇到此问题。同样,即使您没有点击该行(第 3 方框架的),您也需要输入该键。

但后来我遇到了问题,我们添加了该 plist,但后来应用商店审查团队无法对其进行测试,因为该功能受功能标志保护。又因为他们无法测试,所以没有批准 ¯\(ツ) /¯

最后但并非最不重要的一点是,如果您确实需要在 plist 中使用该密钥,请确保其推理足够通用以涵盖所有情况,例如如果您需要访问相机以拍摄个人资料照片和扫描二维码,那么假设您的应用可以在 个人资料照片步骤或扫描 PR 代码时请求访问相机,那么您在 plist 中的描述应该涵盖这两个功能,而不仅仅是其中一个。如果您说“需要访问权限来拍摄个人资料照片”,那么如果用户先点击 QR 流程但看到您请求访问权限来拍摄个人资料照片,您可能会被拒绝。因此你应该说“需要访问权限来拍摄个人资料照片和二维码扫描新设备”

tl;dr 确定您请求访问权限的应用程序流程中的哪个位置。如果您需要它,请将其 key/value 添加到您的 plist 中。如果不需要,则注释掉该行。您不应该仅仅为了通过应用商店审核而添加 plist。它可以失败但也可以成功,而在未来的版本中它会失败...