我正在尝试使用 iOS 9 中的新主动助手功能访问从电子邮件自动创建的事件。这些事件显示在“在邮件中找到的事件”日历中。
要访问这些,我正在执行以下操作
self.eventStore.requestAccessToEntityType(.Event, completion: { (granted, error) -> Void in
let predicate = eventStore.predicateForEventsWithStartDate(NSDate(timeIntervalSince1970: timestamp1), endDate: NSDate(timeIntervalSince1970: timestamp2), calendars: nil)
let events = eventStore.eventsMatchingPredicate(predicate)
}
但是未列出此日历中的事件。这是 Apple 的限制还是我可以通过任何其他方式访问它们?
最佳答案
我向 Apple 工程师提出了这个问题,他们的回答是出于隐私原因,他们不会公开此日历。他们希望用户将从邮件中解析的事件添加到他们的一个普通日历中,以确认他们想要将其公开给其他应用程序,这就是为什么这个日历在正常情况下不可见的原因
let calendars = store.calendarsForEntityType(EKEntityTypeEvent)
关于ios - 访问 "Events Found in Mail"日历中的事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33165525/