NSRemindersUsageDescription

NSRemindersUsageDescription

我的代码:

 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,请遵循以下图像:

单击信息列表

ios - EKEventStore访问请求在iOS 10上崩溃。消息:应用程序的Info.plist必须包含NSRemindersUsageDescription键-LMLPHP

b。单击添加按钮

ios - EKEventStore访问请求在iOS 10上崩溃。消息:应用程序的Info.plist必须包含NSRemindersUsageDescription键-LMLPHP

C。设置密钥NSRemindersUsageDescription
ios - EKEventStore访问请求在iOS 10上崩溃。消息:应用程序的Info.plist必须包含NSRemindersUsageDescription键-LMLPHP

d。填写为什么您的应用需要用户获得此权限的值

ios - EKEventStore访问请求在iOS 10上崩溃。消息:应用程序的Info.plist必须包含NSRemindersUsageDescription键-LMLPHP

编辑

如果在NSRemindersUsageDescription中添加Info.plist,然后出现error,则在NSRemindersUsageDescription中添加TARGET,如下所示,请尝试:

ios - EKEventStore访问请求在iOS 10上崩溃。消息:应用程序的Info.plist必须包含NSRemindersUsageDescription键-LMLPHP

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

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

10-08 01:02