cloudkit – 具有相同订阅的所有用户是否收到公共数据库订阅通知?

前端之家收集整理的这篇文章主要介绍了cloudkit – 具有相同订阅的所有用户是否收到公共数据库订阅通知?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我已经设置了CKSubscription *,以便我收到记录类型的更改.

我正在使用公共数据库.

当我使用相同的用户(相同的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.

https://developer.apple.com/library/ios/documentation/CloudKit/Reference/CKSubscription_class/index.html#//apple_ref/occ/cl/CKSubscription

无论哪个用户编辑记录,我都希望收到通知,而订阅谓词仍应匹配.

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

重启设备,现在工作正常!

解决方法

为了在上面的答案中添加另一个维度,CKSubscriptions将按照每个设备的“每个iCloud帐户”进行记录.登录到同一iCloud帐户(*)的所有设备将根据该iCloud帐户下任何设备输入的任何订阅接收所有通知.当以上引用“用户”时,它们表示“登录到该iCloud帐户的任何设备”.

>除了修改导致通知文件的特定设备

原文链接:https://www.f2er.com/mssql/78694.html

猜你在找的MsSQL相关文章