无效的UPDATE通知的替代方法 [英] Alternatives to UPDATE notification that does not work
问题描述
UPDATE通知停止工作.在苹果弄清楚某些东西之前,您有什么解决方法?
UPDATE notification stopped working. What workaround do you have, until Apple figures out something?
CKFetchNotificationChangesOperation有时不返回UPDATE,DELETE通知 有关记录更新的CloudKit推送通知已停止工作 https://forums.developer.apple.com/thread/7288
我的快速解决方案,即每分钟,当用户触发UIRefreshControl
时,我将下载自上次更新以来已修改的所有记录.有用.但是我心里有一个更好的主意,很好奇,您怎么看.任何弊端.
My quick fix, that in every minute, and when user triggers UIRefreshControl
, then I downloading all the records that were modified since the last update. It works. But I have a better idea in my mind, curious, what do you think. Any drawbacks.
我正在考虑将Change
表添加到数据库中.它将具有一个recordName
,recordType
,changeType
字段. changeType
可以具有insert
,update
,delete
字符串值. (或相应的int枚举)
I am thinking adding a Change
table to the database. It will have a recordName
, recordType
, changeType
fields. changeType
could have insert
, update
, delete
string values. (or int enumerations accordingly)
然后我将仅使用Change
表创建并使用CKSubscription
进行观察.总是在自定义表中创建,更新或删除记录时,我会做两件事,执行该操作,然后作为第二项操作,我将在Change
表中输入一个日志条目" .因为这是Change
中的Insert
操作,并且插入通知似乎有效,所以将通知所有设备.他们可以下载参考记录.
And I would create and observe with CKSubscription
only the Change
table. Always when a record is create, updated, deleted in a custom table, I would do two things, do that action and as a second action I would make a 'log entry' into the Change
table. Because it is an Insert
operation in Change
, and insert notification seems to work, all the device would get notified. They could download the refered record.
您看到任何弊端吗?
推荐答案
我使用了类似的策略.有一些缺点:
I have used a similar strategy. There are some drawbacks:
- 更多数据(存储和传输)的使用
- 有限的订阅可能性,否则您必须复制更多数据.
- 您实际上不想在应用中添加额外的代码.
解决此问题的唯一好的方法是:
The only good solution to this problem is:
- Apple应该修复它...
这篇关于无效的UPDATE通知的替代方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!