我的代码:
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
中:
您应该在NSRemindersUsageDescription
中添加access configuration list
Info.plist
:
方法1)如果您在Xcode中打开info.plist
,请遵循以下图像:
单击信息列表
b。单击添加按钮
C。设置密钥NSRemindersUsageDescription
d。填写为什么您的应用需要用户获得此权限的值
编辑
如果在NSRemindersUsageDescription
中添加Info.plist
,然后出现error
,则在NSRemindersUsageDescription
中添加TARGET
,如下所示,请尝试:
方法2),如果您在源代码中打开info.plist
:
<key>NSRemindersUsageDescription</key>
<string>the describe of your need this permissions </string>