加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > MsSql教程 > 正文

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

发布时间:2020-12-12 06:32:36 所属栏目:MsSql教程 来源:网络整理
导读:我已经设置了CKSubscription *,以便我收到记录类型的更改. 我正在使用公共数据库. 当我使用相同的用户(相同的iCloud帐户)进行测试时,我会收到通知. 如果我使用其他用户(不同的iCloud帐户),我不会收到通知. 订阅是否仅适用于同一用户的设备之间? 以下是描述订
我已经设置了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帐户的任何设备”.

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读