且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Swift 4.0 Eventkit无法正确获取日历和事件

更新时间:2023-12-03 14:20:34

经过反复试验,我找到了答案.

After lots of trial and error, I found the answer.

即使未对应用程序进行沙箱处理,也需要在权利文件中将com.apple.security.personal-information.calendars键设置为是". Apple的EventKit实现中存在一个错误,该错误会阻止您的应用访问即使未启用沙箱,日历也不会设置此键.

You need to set the com.apple.security.personal-information.calendars key to YES in your entitlements file, even if your app is not sandboxed. There is a bug in Apple's implementation of EventKit that prevents your app getting access to calendars if it does not set this key, even if the sandbox is disabled.