假设记录的所有者与我共享它。我收到了一个分享链接,我打开它并接受这样的分享:
let operation = CKAcceptSharesOperation(shareMetadatas: [metadata])
operation.acceptSharesCompletionBlock = { error in
if let error = error{
print("accept share error: \(error)")
}else{
//Share accepted...
}
}
CloudKit.container.add(operation)
我之前也订阅了共享数据库,如下所示:
let subscriptionSharedDatabase = CKDatabaseSubscription(subscriptionID: "subscriptionSharedDatabase")
let sharedInfo = CKSubscription.NotificationInfo()
sharedInfo.shouldSendContentAvailable = true
sharedInfo.alertBody = "" //This needs to be set or pushes don't get sent
subscriptionSharedDatabase.notificationInfo = sharedInfo
let subShared = CKModifySubscriptionsOperation(subscriptionsToSave: [subscriptionSharedDatabase], subscriptionIDsToDelete: nil)
CloudKit.sharedDB.add(subShared)
但是现在假设该记录的所有者CKShare
删除了我作为该记录的参与者并将更新的参与者列表保存到 CloudKit。
据我所知,我得到的唯一通知是另一个共享数据库订阅 ( subscriptionSharedDatabase
) 更改,但没有更改或删除任何记录(我查看并获取它们时没有更改的记录)。
据我所知,通知参与者更改的唯一方法CKShare
是订阅cloudkit.share
记录类型的通知,但这在共享数据库中对我不可用,对吗?
当我从 中删除时如何通知我CKShare
?