Alternatives to UPDATE notification that does not work

旧城冷巷雨未停 提交于 2020-01-07 03:25:07

问题


UPDATE notification stopped working. What workaround do you have, until Apple figures out something?

CKFetchNotificationChangesOperation sometimes does not return UPDATE, DELETE notifications CloudKit push notifications on record update stopped working https://forums.developer.apple.com/thread/7288

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.

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)

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.

Do you see any drawbacks?


回答1:


I have used a similar strategy. There are some drawbacks:

  • more data (storage and transfer) usage
  • limited subscription possibilities or you have to duplicate even more data.
  • extra code in your app that you actually don't want to be there.

The only good solution to this problem is:

  • Apple should fix it...


来源:https://stackoverflow.com/questions/31499029/alternatives-to-update-notification-that-does-not-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!