iOS 提交应用时出现 10 GM 发布错误 "app attempts to access privacy-sensitive data without a usage description" 由于 GoogleSignIn、AdMob

iOS 10 GM release error when submitting apps "app attempts to access privacy-sensitive data without a usage description" due to GoogleSignIn, AdMob

我刚开始在 iOS 10 GM 版本中遇到这个问题。我收到一封电子邮件说:

To process your delivery, the following issues must be corrected:

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.

Once the required corrections have been made, you can then redeliver the corrected binary.

Regards,

The App Store team

我正在使用 google GoogleSignIn。我没有使用 Firebase,但在使用 cocoa pods 安装 GoogleSignIn 时,我在日志中看到它自动安装了 Firebase。

除了必须定义这些键之外,我们还能做些什么吗,因为我的应用与相机/照片等无关,因此我不希望用户认为我们正在使用它们。

我注意到其他人也遇到了这个问题: https://forums.developer.apple.com/thread/62229

有没有可能Google框架使用了一些额外的系统框架,需要用户权限(即用户位置),而你忘记在.plist文件中添加相关描述!仔细检查一下。

某些使用权限描述在 iOS10 中成为强制性的。

在 iOS10 中,Apple 要求在 Info.plist 中为任何需要弹出窗口的功能定义使用说明。参见 http://useyourloaf.com/blog/privacy-settings-in-ios-10/

在 Beta 计划期间,如果未设置使用说明,应用会在显示提示时崩溃。

看来 iTunes Connect 验证工具已更改为在应用程序中查找与权限相关对象关联的 类 的引用。如果没有 Info.plist 条目,他们将拒绝二进制文件。

我在我自己的一个应用程序中看到了这一点,我在库中有一个旧的辅助方法来检测相机是否存在。尽管该应用程序从未调用过该方法,但它已链接到我的二进制文件中,因为我确实在同一文件中使用了另一种方法。该应用程序没有使用相机,因此没有定义 Info.plist 条目。它被拒绝了。我只是删除了我的辅助方法,并将检查移到了其他使用它的应用程序中。

但是,AdMob 似乎引用了日历,因此无法提交我拥有的使用广告但不使用日历本身的应用程序。谢谢Google!

编辑: 请参考上面的答案 其中列出了 google 的官方解决方法。请注意,解决方法缺少一个额外的密钥,这也是必需的:NSCameraUsageDescription

我使用的变通解决方案:Google 的 AdMob 框架和 GoogleSignIn 会自动安装 firebase,它使用此类权限,即使应用程序从未使用过。在 info.plist 中定义 NSCameraUsageDescription 后,它让我可以毫无问题地提交,希望应用程序不会提示用户,这样他们也不会看到文本。

这是 link 到 Google 的完整解决方法: https://groups.google.com/d/msg/google-admob-ads-sdk/UmeVUDrcDaw/HIXR0kjUAgAJ

更多信息见 link,但 TL;DR 版本是您必须向 plist 添加三个项目:

<key>NSCalendarsUsageDescription</key>
<string>Advertisement would like to create a calendar event.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Advertisement would like to store a photo.</string>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>Advertisement would like to use bluetooth.</string>

如果您是 ESRI 的 ArcGIS.framework,请确保添加此密钥。

in iOS 10 如果您在应用中使用相机或照片库,则需要添加下图中提到的密钥

您必须在 Info.Plist 中获得相机的许可。转到 Info.plist 并添加以下代码。

Key       :  Privacy - Camera Usage Description   
Value     :  $(PRODUCT_NAME) camera use

查看此参考:

已在 7.11.0 上修复https://firebase.google.com/docs/admob/release-notes

确保更新 SDK

这是所有的私钥,我们需要手动将它们添加到 Info.plist 中并附上简短说明。

•       Bluetooth Sharing – NSBluetoothPeripheralUsageDescription
•       Calendar – NSCalendarsUsageDescription
•       CallKit – NSVoIPUsageDescription
•       Camera – NSCameraUsageDescription
•       Contacts – NSContactsUsageDescription
•       Health – NSHealthShareUsageDescription & NSHealthUpdateUsageDescription
•       HomeKit – NSHomeKitUsageDescription
•       Location – NSLocationUsageDescription, NSLocationAlwaysUsageDescription, NSLocationWhenInUseUsageDescription
•       Media Library – NSAppleMusicUsageDescription
•       Microphone – NSMicrophoneUsageDescription
•       Motion – NSMotionUsageDescription
•       Photos – NSPhotoLibraryUsageDescription
•       Reminders – NSRemindersUsageDescription
•       Speech Recognition – NSSpeechRecognitionUsageDescription
•       SiriKit – NSSiriUsageDescription
•       TV Provider – NSVideoSubscriberAccountUsageDescription