0

My app has CKSubscriptions to record changes. When changes occur, a push notification is received, and a CKFetchNotificationChangesOperation is created with the last saved serverChangeToken to retrieve the latest notifications.

This all works fine, except for when I log off iCloud from the settings app. If I log off iCloud, my app doesn't fetch any of the notifications received from the time I logged off until the time I log back into iCloud and relaunch my app. However, when I check the data on the serverChangeToken, it's the same data that was saved before I logged out of the iCloud. I can also receive new notifications once I relaunch the app, but I lose all the notifications received after I logged off.

Does anyone know if CKSubscription push notifications get dropped somehow once I log off iCloud? That doesn't make much sense, since the CKFetchNotificationChangesOperation is supposed to fetch all the notifications based on the provided serverChangeToken.

powertoold
  • 1,593
  • 13
  • 19
  • Are you working with the public database or private database? If private, are you using zones? – rmaddy Apr 28 '16 at 02:41
  • Hello, I have CKSubscriptions to record types in both public and private databases. CKFetchNotificationChangesOperation isn't database specific though. All it needs is the serverChangeToken, and it's supposed to send you all the notifications received after that particular token. The push notifications are fetched just fine when I'm still logged into iCloud, even when I put the app in the background and then go back with applicationWillEnterForeground (I'm not using background push notifications). Thanks for your help! – powertoold Apr 28 '16 at 02:50
  • I was asking because if you are using zones on the private database, you can try using `CKFetchRecordChangesOperation` to get all missed changes. – rmaddy Apr 28 '16 at 02:53

0 Answers0