What makes NSCalendarsUsageDescription required?

后端 未结 5 1256
抹茶落季
抹茶落季 2020-12-24 02:51

When I upload to iTunes Connect, my app gets the error that the NSCalendarsUsageDescription privacy is not provided. I am aware that this information is now man

相关标签:
5条回答
  • 2020-12-24 02:54

    For anyone wondering why all of a sudden your app now has all these permission settings in the first place it could be because of CocoaPods or Carthage - they put in hooks to all of these permissions. I just upgraded my app to use cordova-plugin-firebasex which has an extensive Cocoapods (and dependencies) installation. You can turn these permissions off BEFORE you install cocoapods into your project by putting a PermissionsConfiguration.xcconfig in the root of your project - you can read more about this here: https://cocoapods.org/pods/Permission#installation

    This all surprised me when the new version of my app was rejected with 7 permissions key/string missing from Info.plist file. I then had to dig into my project to find what was causing this since my app doesn't need or use any of these permissions (never has).

    It may exist but at the moment I can't find a way to remove permissions after pods integration...going to have to dig around on how to do this without starting my project over.

    0 讨论(0)
  • 2020-12-24 02:55

    You could try using nm tool to look for EventKit specific symbols in your frameworks binaries, something like:

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

    Or one-liner (look for files without extension, also ignore CodeResources to reduce irrelevant output):

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

    If there is such you will see something like:

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

    To learn more about nm run man nm in your terminal.

    The nm tool is useful when you want to see which symbols a given binary contains. There are plenty of options that you can give to nm but most of the time it is enough to run it without any arguments to answer questions like: is symbol X present in a given binary?

    0 讨论(0)
  • 2020-12-24 02:56

    According to apples documentation:

    NSCalendarsUsageDescription (String - iOS) This key lets you describe the reason your app accesses the user’s calendars. When the system prompts the user to allow access, this string is displayed as part of the alert.

    it then goes on to explain how to implement it:

    Important: To protect user privacy, an iOS app linked on or after iOS 10.0, and which accesses the user’s calendars, must statically declare the intent to do so. Include the NSCalendarsUsageDescription key in your app’s Info.plist file and provide a purpose string for this key. If your app attempts to access the user’s calendars without a corresponding purpose string, your app exits.

    Basically just insert this into you info.plist file

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

    you can read more about cocoa keys here

    0 讨论(0)
  • 2020-12-24 03:06

    Update you Info.plist file by adding permission base on your rejection mail or error log.

    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>
    

    OR

    Resolving the Privacy-Sensitive Data App Rejection

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

    0 讨论(0)
  • 2020-12-24 03:16

    Update to new version of AdMob SDK solved my issue.

    0 讨论(0)
提交回复
热议问题