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

倾然丶 夕夏残阳落幕 提交于 2021-02-20 00:48:28

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!