EKEventStore 访问请求在 iOS 10 上崩溃。Message:The 应用的 Info.plist 必须包含 NSRemindersUsageDescription 键
EKEventStore access request crashes on iOS 10. Message:The app's Info.plist must contain an NSRemindersUsageDescription key
我的代码:
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
access configuration list
:
方法 1) 如果您在 Xcode 中打开 info.plist
,请按照以下图片操作:
a.click Info.plist
b.click 添加按钮
c。设置密钥 NSRemindersUsageDescription
d.fill您的应用需要用户此权限的原因
编辑
如果你在你的Info.plist
中添加NSRemindersUsageDescription
,然后出现error
,你在你的TARGET
中添加NSRemindersUsageDescription
,有一试:
方法2)如果你在源代码中打开你的info.plist
:
<key>NSRemindersUsageDescription</key>
<string>the describe of your need this permissions </string>
我的代码:
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
access configuration list
:
方法 1) 如果您在 Xcode 中打开 info.plist
,请按照以下图片操作:
a.click Info.plist
b.click 添加按钮
c。设置密钥 NSRemindersUsageDescription
d.fill您的应用需要用户此权限的原因
编辑
如果你在你的Info.plist
中添加NSRemindersUsageDescription
,然后出现error
,你在你的TARGET
中添加NSRemindersUsageDescription
,有一试:
方法2)如果你在源代码中打开你的info.plist
:
<key>NSRemindersUsageDescription</key>
<string>the describe of your need this permissions </string>