什么使NSCalendarsUsageDescription成为必需?

时间:2016-09-24 13:16:34

标签: itunesconnect xcode8

当我上传到iTunes Connect时,我的应用会收到错误,即未提供NSCalendarsUsageDescription隐私。我知道这些信息现在是强制性的,但我不知道我的应用程序使用了哪些内容需要此隐私使用说明。

我的应用在做什么/使用它需要NSCalendarsUsageDescription

Dear developer,

We have discovered one or more issues with your recent delivery for "MyApp". 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 NSCalendarsUsageDescription key with a string value explaining to the user how the app uses this data.

Once these issues have been corrected, you can then redeliver the corrected binary.

Regards,

The App Store team

编辑:不是重复的,因为解决方案不起作用,因为我已经对第一个答案进行了评论以及可能的副本实际上没有回答的问题是什么(通常)需要使用此用法说明

5 个答案:

答案 0 :(得分:15)

您可以尝试使用nm工具在框架二进制文件中查找EventKit特定符号,例如:

nm YourFramework.framework/YourFramework | grep EK # EK is a prefix for EventKit classes

或单行(查找没有扩展名的文件,也忽略CodeResources以减少不相关的输出):

find YourApp/Frameworks ! -name '*CodeResources*' -type f ! -name "*.*" -exec nm -o -- {} + | grep EK

如果有这样的话,你会看到类似的东西:

0000000000003fdb t -[ClusterPrePermissions EKEquivalentEventType:]
                 U _OBJC_CLASS_$_EKEventStore

答案 1 :(得分:12)

通过添加拒绝邮件的权限或错误日志来更新 Info.plist 文件。

<强> NSCameraUsageDescription

<key>NSCameraUsageDescription</key>
    <string>$(PRODUCT_NAME) camera use.</string>

<强> NSContactsUsageDescription

<key>NSContactsUsageDescription</key>
    <string>$(PRODUCT_NAME) contacts use.</string>

<强> NSPhotoLibraryUsageDescription

<key>NSPhotoLibraryUsageDescription</key>
    <string>$(PRODUCT_NAME) photos and video use.</string>

<强> NSBluetoothPeripheralUsageDescription

<key>NSBluetoothPeripheralUsageDescription</key>
    <string>$(PRODUCT_NAME) bluetooth use.</string>

<强> NSMicrophoneUsageDescription

<key>NSMicrophoneUsageDescription</key>
    <string>$(PRODUCT_NAME) microphone use.</string>

<强> NSMotionUsageDescription

<key>NSMotionUsageDescription</key>
    <string>$(PRODUCT_NAME) motion use.</string>

<强> NSLocationAlwaysUsageDescription

<key>NSLocationAlwaysUsageDescription</key>
    <string>$(PRODUCT_NAME) location use.</string>

<强> NSLocationUsageDescription

<key>NSLocationUsageDescription</key>
    <string>$(PRODUCT_NAME) location use.</string>

<强> NSLocationWhenInUseUsageDescription

<key>NSLocationWhenInUseUsageDescription</key>
    <string>$(PRODUCT_NAME) location use.</string>

<强> NSRemindersUsageDescription

<key>NSRemindersUsageDescription</key>
    <string>$(PRODUCT_NAME) reminders use.</string>

<强> NSSiriUsageDescription

<key>NSSiriUsageDescription</key>
    <string>$(PRODUCT_NAME) siri use.</string>

<强> NSVideoSubscriberAccountUsageDescription

<key>NSVideoSubscriberAccountUsageDescription</key>
    <string>$(PRODUCT_NAME) video use.</string>

<强> NSSpeechRecognitionUsageDescription

<key>NSSpeechRecognitionUsageDescription</key>
    <string>$(PRODUCT_NAME) speech recognition use.</string>

<强> NSCalendarsUsageDescription

<key>NSCalendarsUsageDescription</key>
    <string>$(PRODUCT_NAME) user your calendar.</string>

或者

解决隐私敏感数据应用拒绝问题

https://developer.apple.com/library/content/qa/qa1937/_index.html

答案 2 :(得分:9)

根据苹果文件:

  

NSCalendarsUsageDescription(String - iOS)此键可让您描述应用访问用户日历的原因。当系统提示用户允许访问时,此字符串将显示为警报的一部分。

然后继续解释如何实现它:

  

重要提示:为了保护用户隐私,iOS 10.0上或之后链接的iOS应用程序访问用户的日历,必须静态声明这样做的意图。在应用程序的Info.plist文件中包含NSCalendarsUsageDescription键,并为此键提供目的字符串。如果您的应用尝试访问用户的日历而没有相应的用途字符串,则您的应用会退出。

基本上只需将此插入info.plist文件

即可
 <key>NSCalendarsUsageDescription</key>
<string>purpose for using calendar</string>

您可以阅读有关可可键的更多信息 here

答案 3 :(得分:5)

更新到新版本的AdMob SDK解决了我的问题。

答案 4 :(得分:0)

对于想知道为什么您的应用程序突然之间现在拥有所有这些权限设置的人,可能是因为CocoaPods或Carthage引起的,他们对所有这些权限都产生了迷惑。我刚刚将我的应用升级为使用cordova-plugin-firebasex,它具有广泛的Cocoapods(和依赖项)安装。您可以在将cocoapods安装到项目中之前,通过在项目的根目录中放置PermissionsConfiguration.xcconfig来关闭这些权限-您可以在此处了解更多信息:https://cocoapods.org/pods/Permission#installation

当我的应用程序的新版本被Info.plist文件中缺少7个权限key/string拒绝时,这一切令我感到惊讶。然后,我不得不深入研究我的项目,以找出造成此问题的原因,因为我的应用不需要或不使用任何这些权限(从没有)。

它可能存在,但目前在pod集成之后我找不到删除权限的方法...必须在不重新开始我的项目的情况下深入研究如何执行此操作。