我的代码:
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
b.点击添加按钮
设置 key NSRemindersUsageDescription
d.填写为什么你的应用需要用户的权限
编辑
如果您在Info.plist
中添加NSRemindersUsageDescription
,然后出现错误
,您添加NSRemindersUsageDescription
在你的 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/