2

My app stores locally all the records that CloudKit stores. So it is not the big data small phone concept, but all data server - all data client concept. I need all the updates from time to time when app launches again.

Should I set up for all existing record type CKSubscription?

  • It might come to much notification from server, even though I guess there is a 'silent mode', there should be a limit on storagecapacity of iCloud notification collection.

Should I delete all local record when app launches and download again from CloudKit to get the updates?

  • Need to update too much data every time.
János
  • 32,867
  • 38
  • 193
  • 353

1 Answers1

3

CloudKit has the CKFetchRecordChangesOperation for this. You can request all changes within a zone since the previous update. You can then synchronize that data with the storage inside your app.

If you do use subscriptions, then if there are multiple notifications send in a short period, there is a big chancre that your app won't get all notifications. Apple will limit that. This is why after processing received subscription notifications you should also execute a CKFetchNotificationChangesOperation after you received a notification.

lewis
  • 2,936
  • 2
  • 37
  • 72
Edwin Vermeer
  • 13,017
  • 2
  • 34
  • 58
  • so you recommend for frequently changing record types only use `CKFetchRecordChangesOperation` without remote notification? – János Dec 30 '14 at 11:18
  • 1
    yes, ckFetchRecordChangesOperation will work without CKSubscription. You will even get all data from all recordTypes that are changed. Choosing this over subscriptions is a functional decision. You could use both if you have a recordType with important data that requires to be up to date. Then do remember that you will also receive the same changes with the CKFetchRecordChangesOperation – Edwin Vermeer Dec 30 '14 at 11:23
  • 1
    You also have to be aware that the CKFetchRecordChangesOperation will give you all data within a zone. So if the client does not need all the data, then this is probably not right for you. – Edwin Vermeer Dec 30 '14 at 11:26
  • `CKFetchRecordChangesOperation` is deprecated as of iOS 10 :( – lewis Apr 08 '20 at 06:34