【发布时间】:2016-08-17 12:27:59
【问题描述】:
我正在尝试使用 CKSubscription 订阅更改。我正在关注 Apple 的文档,该文档似乎非常笼统且不完整。 Link to Apple Doc
我已经知道通过AppDelegate 中的didReceiveRemoteNotification 方法将记录ID 发送到我的应用程序,并且我有我的记录ID:使用此代码:
func application(application: NSApplication, didReceiveRemoteNotification userInfo: [String : AnyObject]) {
let cknNotification = CKNotification(fromRemoteNotificationDictionary: userInfo as! [String:NSObject])
if cknNotification.notificationType == .Query,
let queryNotification = cknNotification as? CKQueryNotification {
let recordId = queryNotification.recordID
print(recordId)
}
如何将 CKNotification 转换为存储在 Cloudkit 中的实际对象?我是否需要执行另一次提取,或者是我只需要转换的 CKNotification 中包含的数据。
【问题讨论】:
标签: macos cloudkit cksubscription cknotification