Search code examples
iosekeventstore

EKEventStore access request crashes on iOS 10. Message:The app's Info.plist must contain an NSRemindersUsageDescription key


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.


Solution

  • 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>