问题
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.
回答1:
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
b.click the add button
c. set the key NSRemindersUsageDescription
d.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:
Method 2) if you open your info.plist in source code:
<key>NSRemindersUsageDescription</key>
<string>the describe of your need this permissions </string>
来源:https://stackoverflow.com/questions/40777416/ekeventstore-access-request-crashes-on-ios-10-messagethe-apps-info-plist-must