CKFetchNotificationChangesOperation sometimes does

2020-02-07 01:43发布

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:

enter image description here

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条回答
劳资没心,怎么记你
2楼-- · 2020-02-07 02:22

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.

查看更多
登录 后发表回答