我正在使用公共数据库.
当我使用相同的用户(相同的iCloud帐户)进行测试时,我会收到通知.
如果我使用其他用户(不同的iCloud帐户),我不会收到通知.
以下是描述订阅的文档:
Use a CKSubscription object to track changes occurring on the server.
A subscription acts like a persistent query on the server that can
track the creation,deletion,and modification of records. When
changes occur,they trigger the delivery of push notifications so that
your app can respond appropriately.
无论哪个用户编辑记录,我都希望收到通知,而订阅谓词仍应匹配.
UPDATE
*每个用户都有一个具有相同谓词的订阅,主要关注具有特定属性值的单个recordType.
此订阅的有效负载仅用于推送shouldSendContentAvailable = YES.
When this property is YES,the server includes the content-available
flag in the push notification’s payload. That flag causes the system
to wake or launch an app that is not currently running. The app is
then given background execution time to download any data related to
the push notification,such as the set of records that changed. If the
app is already running in the foreground,the inclusion of this flag
has no additional effect and the notification is delivered to the app
delegate for processing as usual.
recordType的安全权限是:
进一步更新
检查设备未接收推送的日志,并且看到:
apsd[85]: Silent Push: Deny app not available
重启设备,现在工作正常!