由于缺少 NSCalendarsUsageDescription,iTunes Connect 上传被无效二进制文件拒绝

iTunes Connect upload rejected with invalid binary because of missing NSCalendarsUsageDescription

我正在尝试使用 XCode 上传现有应用程序的更新 8. 上传后我收到了这封电子邮件:

"This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSCalendarsUsageDescription key with a string value explaining to the user how the app uses this data."

我知道 iOS10 的新隐私政策以及如何添加所需的说明。我的问题是:我没有在我的应用程序中使用日历。

有没有办法找出 Apple 认为我使用日历的原因?也许它被来自 Google 的 AdMobSDK 使用了?

我已经向 Google 发送了一封电子邮件来抱怨这个问题,希望它会在 AdMob SDK 的未来版本中得到解决。在此之前,您可以通过将 NSCalendarsUsageDescription 添加到 info.plist 来解决此问题。我也必须对 NSBluetoothPeripheralUsageDescription 做同样的事情。

编辑:添加 NSPhotoLibraryUsageDescription 也很重要,请参阅:https://groups.google.com/forum/#!category-topic/google-admob-ads-sdk/ios/UmeVUDrcDaw

2016 年 9 月 18 日更新:Google 已发布版本 7.11.0,不再需要这些。

如果您使用 EventKit 框架,这可能会触发您从 Apple 收到的自动拒绝。一种解决方案是删除该框架。

Tapjoy(11.8.1 之前的版本)和 AdMob 等许多广告 SDK 都将 EventKit 作为必需的框架。

如果您的应用程序中有 EventKit 框架,因为它是您的广告 SDK 所必需的,我发现通过对 .plist 文件进行以下修改可以避免这种拒绝:

<key>NSCalendarsUsageDescription</key>
<string>Some ad content may access calendar</string>

and 回答正确:)

在我这边,我的 xcode 项目每次都会生成,所以这里有一种使用 PlistBuddy 从命令行设置这些值的方法(我还需要 NSCameraUsageDescription):

/usr/libexec/PlistBuddy -c "Add :NSCameraUsageDescription string" ./Info.plist || true
/usr/libexec/PlistBuddy -c "Set :NSCameraUsageDescription 'not used'" ./Info.plist

/usr/libexec/PlistBuddy -c "Add :NSCalendarsUsageDescription string" ./Info.plist || true
/usr/libexec/PlistBuddy -c "Set :NSCalendarsUsageDescription 'Some ad content may access calendar'" ./Info.plist

/usr/libexec/PlistBuddy -c "Add :NSPhotoLibraryUsageDescription string" ./Info.plist || true
/usr/libexec/PlistBuddy -c "Set :NSPhotoLibraryUsageDescription 'Some ad content may access photo library'" ./Info.plist

使用带有构建目标 IOS 10.0 的 Xcode V9,我必须将其添加到 local.plist 而不是主应用程序 plist:

 {
     "NSCalendarsUsageDescription" = "This App needs to use your calendar";
 }