ios - EKEventStore 访问请求在 iOS 10 上崩溃。消息 :The app's Info. plist 必须包含 NSRemindersUsageDescription 键

标签 ios ekeventstore

我的代码:

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

}];

应用程序的 Info.plist 已经包含 NSRemindersUsageDescription 键和 NSCalendarsUsageDescription 键, 但 下面的代码在 iOS 8 和 9 上运行良好,但在 iOS 10 上它崩溃了。比如:

  [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.

最佳答案

ios10 中:

您应该在 Info.plist 中添加 NSRemindersUsageDescription 访问配置列表:

方法 1) 如果您在 Xcode 中打开您的 info.plist,请按照下图操作:

a.点击Info.plist

click Info.plist

b.点击添加按钮

click the add button

设置 key NSRemindersUsageDescription

set the rescribe name

d.填写为什么你的应用需要用户的权限

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

编辑

如果您在Info.plist中添加NSRemindersUsageDescription,然后出现错误,您添加NSRemindersUsageDescription 在你的 TARGET 中,试一试:

add describe in target

方法2)如果你在源代码中打开你的info.plist:

<key>NSRemindersUsageDescription</key>
<string>the describe of your need this permissions </string>

关于ios - EKEventStore 访问请求在 iOS 10 上崩溃。消息 :The app's Info. plist 必须包含 NSRemindersUsageDescription 键,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40777416/

相关文章:

ios - WkWebview 中的自动填充、保存密码、拼写检查、应用程序缓存

ios - 为什么给 addArcWithCenter 一个 0 度的 startAngle 会使它从 90 度开始?

ios - 如何从 XMPPRoster 获取好友?

ios - cellForRowAtIndexPath中的NSRangeException

ios - 确定您的应用程序是否可以在不启动请求的情况下访问日历?

swift - 将 NSDateComponents 传递给 UILocalNotification 的最佳实践?

iphone - 在 iPhone 中将事件添加到默认日历时出错

ios - 如何在 iOS 中更新或编辑 EKEvent 并使用标识符存储在 native 日历中?

ios - Ekevents 在日历中多次添加?

objective-c - 在 Objective - C 中乘以预处理器常量