由于 GoogleSignIn 和 AdMob,iOS 10 GM 在提交应用程序时出现“应用程序尝试访问没有使用说明的隐私敏感数据”的发布错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/39383289/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 10:05:12  来源:igfitidea点击:

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

iosfirebaseadmobgoogle-signin

提问by Pranoy C

I just started facing this issue with the iOS 10 GM release. I received an email saying:

我刚刚在 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

要处理您的交货,必须更正以下问题:

此应用程序尝试在没有使用说明的情况下访问隐私敏感数据。应用程序的 Info.plist 必须包含一个 NSCameraUsageDescription 键和一个字符串值,向用户解释应用程序如何使用这些数据。

完成所需的更正后,您可以重新交付更正后的二进制文件。

问候,

应用商店团队

I am using google GoogleSignIn. I am not using Firebase, but when installing GoogleSignIn with cocoa pods, I saw in the logs it automatically installed Firebase.

我正在使用谷歌 GoogleSignIn。我没有使用 Firebase,但是在使用可可豆荚安装 GoogleSignIn 时,我在日志中看到它自动安装了 Firebase。

Is there something we can do other than having to define these keys as my app has nothing to do with camera / photos etc and hence I don't want users to think we are using them.

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

I notice someone else has also faced this issue: https://forums.developer.apple.com/thread/62229

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

回答by kevcol

Here's a link to a complete workaround from Google: https://groups.google.com/d/msg/google-admob-ads-sdk/UmeVUDrcDaw/HIXR0kjUAgAJ

以下是 Google 提供的完整解决方法的链接:https: //groups.google.com/d/msg/google-admob-ads-sdk/UmeVUDrcDaw/HIXR0kjUAgAJ

More info at that link, but TL;DR version is you have to add three items to your plist:

该链接上的更多信息,但 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>

回答by Pritesh

in iOS 10 you need to add the key mentioned in below image if you are using camera or photo gallery in your appenter image description here

在 iOS 10 中,如果您在应用程序中使用相机或照片库,则需要添加下图中提到的密钥在此处输入图片说明

回答by Geoff Hackworth

In iOS 10 Apple have made it a requirement to define the usage description in the Info.plist for any feature that requires a popup. See http://useyourloaf.com/blog/privacy-settings-in-ios-10/

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

During the beta program, apps would crash at the time they would show the prompt if the usage description was not set.

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

It looks like the iTunes Connect validation tools have been changed to look for references in the app to classes that are associated with permission-related objects. If there isn't an Info.plist entry, they reject the binary.

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

I saw this in one of my own apps where I had an old helper method in a library that detected whether the camera existed or not. Even though the app never called that method, it was being linked into my binary because I did use another method in the same file. That app didn't use the camera and so didn't define the Info.plist entry. And it was rejected. I simply removed my helper method and moved the checks into the other apps that did use it.

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

However, AdMob seems to have references to the Calendar so an app I have which uses ads, and does not use the Calendar itself, can't be submitted. Thanks Google!

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

回答by Kirit Modi

You have to permission of Camera in Info.Plist. goto Info.plist and add below code.

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

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

See this ref :enter image description here

看到这个参考:在此处输入图片说明

回答by Kiran K

Here is the all Privacy Keys, We need to manually add them into the Info.plist with short description.

这是所有的隐私密钥,我们需要手动将它们添加到 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

回答by Pranoy C

EDIT:Please refer to the answer above https://stackoverflow.com/a/39476283/1634905which lists the official workaround by google. NOTE that the workaround is missing an additional key which will be required too: NSCameraUsageDescription

编辑:请参阅上面的答案https://stackoverflow.com/a/39476283/1634905,其中列出了谷歌的官方解决方法。请注意,解决方法缺少一个额外的密钥,这也是必需的:NSCameraUsageDescription

Workaround Solution I used: Google's frameworks for AdMob and GoogleSignIn installs firebase automatically which uses such permissions even though the app never does. After I defined NSCameraUsageDescriptionin the info.plist, it let me submit without problem hoping that the app won't prompt the user ever so they won't see the text either.

我使用的解决方法解决方案:Google 的 AdMob 和 GoogleSignIn 框架会自动安装 Firebase,即使该应用程序从不这样做,它也会使用此类权限。我定义后NSCameraUsageDescriptioninfo.plist,它让我提交没有问题,希望该应用程序将不会提示用户永远所以他们将不会看到任何文字。

回答by GrizzlyBear

Is it possible that the Google Framework uses some additional system framework that require the user permission (i.e., the user position) and you forget to add the related description in the .plist file! Double check that.

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

Some of the usage permission description became mandatory in iOS 10.

一些使用权限描述在 iOS 10 中成为强制性的。

回答by ayalcinkaya

Fixed on 7.11.0 https://firebase.google.com/docs/admob/release-notes

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

Make sure you update the SDK

确保您更新了 SDK

回答by Marius

Make sure you're adding this key if you're ESRI's ArcGIS.framework.

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