CKFetchNotificationChangesOperation sometimes does not return UPDATE, DELETE notifications

烂漫一生 提交于 2019-11-27 07:44:10

问题


CKFetchNotificationChangesOperation returns INSERT operations, but UPDATE and DELETE, not always. DELETE, UPDATE worked last when I submitted app to App Store, but now not anymore. Why? I have created subscriptions like:

let s = CKSubscription(recordType: recordType, predicate: NSPredicate(value: true), options: .FiresOnRecordCreation | .FiresOnRecordUpdate | .FiresOnRecordDeletion)
s.notificationInfo = CKNotificationInfo()
subscriptionsToSave.append(s)

Dashboard shows all tree triggers:

I do not use any alertBody, so notification is a so called silent notification, can it be the cause?

In CloudKit Tips and Tricks lecturer says that subscription needs APS capability for app ID turned on from the developer portal. I don't think I have, but I just want fetch notifications, push only if this works.

Background capabilities? - same

Need to set up APS environment key in app's info plist. - I guess I have it.


回答1:


I know this question is old, but for those Googling, be sure to check out this thorough post on the inconsistency of notifications:

Silent pushes not delivered to the app on iOS 11

I found a particularly subtle fix that I mention here.



来源:https://stackoverflow.com/questions/31103522/ckfetchnotificationchangesoperation-sometimes-does-not-return-update-delete-not

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