2

My Code:

 EKEventStore* eventStore = [[EKEventStore alloc] init];
 [eventStore requestAccessToEntityType:EKEntityTypeReminder  
            completion:^(BOOL granted, NSError * _Nullable error) {

}];

The app's Info.plist already contain an NSRemindersUsageDescription key and NSCalendarsUsageDescription key, but the code below works fine on iOS 8 and 9, but on iOS 10 it crashes .like:

  [access] This app has crashed because it attempted 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.

Mr.Wang
  • 25
  • 4

2 Answers2

7

In ios10:

You should add NSRemindersUsageDescription access configuration list in your Info.plist:

Method 1) if you open your info.plist in Xcode, follow below images:

a.click Info.plist

click Info.plist

b.click the add button

click the add button

c. set the key NSRemindersUsageDescription

set the rescribe name

d.fill the value why your app need user’s this permission

fill the value  why your app need user’s this permission

EDIT

If you add the NSRemindersUsageDescription in your Info.plist, then appear the error, you add the NSRemindersUsageDescription in your TARGET like this, have a try:

add describe in target

Method 2) if you open your info.plist in source code:

<key>NSRemindersUsageDescription</key>
<string>the describe of your need this permissions </string>
aircraft
  • 25,146
  • 28
  • 91
  • 166
0

Updated for Xcode 14.3

The key is now called "Privacy - Calendars Usage Description"

pratbr00
  • 21
  • 3