Search code examples
ioscloudkit

Is it worth save change token to get CloudKit updates from a certain date?


The binary downloaded from App Store already contains a persistent store prefilled with CloudKit data. Is it worth, is it a good approach to store the change token as well, that represents the "date" when data was downloaded from CloudKit, and latter download only the changes / deltas from time to time?

A certain change token represents the same on each device / for each users?


Solution

  • I think that depends on: - the amount of data in your recordType. If you have a lot of data, then you definitely only want to fetch updates. - how much of that data is required in your app. Do you need all the data to be present inside your app. - if it could be handled with subscriptions. so that you could just do an initial query and assume that all changes arrive in notifications.

    The question is what kind of behavior do you want in your app. If there are only a couple of update a day, then a subscription should be good enough. If you need to download large chunks of data every day, then query for everything from a change token.

    a change token for a record is the same for every user.