订阅 sharedDB 中的记录更改 cloudkit

Subscribing to record changes in sharedDB cloudkit

似乎CKQuerySubscription不能用于订阅云工具包中的共享数据库更改。 CKDatabaseSubscription 既无效也无效 CKSubscription

如何实现订阅共享数据库更改?

简单。我如何才能获得有关与我共享的记录更改的通知。 我不是记录的所有者。

相关问题在这里:

How to receive cloudkit notifications about changes made on record shared with me?

事实证明,无法在 CloudKit 中订阅区域级别或共享数据库的记录级别。参考:https://developer.apple.com/library/content/qa/qa1917/_index.html

Be aware that CKQuerySubscription is not supported in the shared database, and 
CKDatabaseSubscription currently only tracks the changes from custom zones in the private and shared database.

当数据库已与我共享时,我努力使用 CKDatabaseSubscription 成功订阅了一段时间。当我是一个共享者时,它工作得很好。我犯的错误是我在这两种情况下都使用了相同的 subscriptionID。如果您想订阅共享数据库,您需要一个唯一的 subscriptionID。