I am working on CloudKit synchronization in my application (Small Data, All Devices model with a user zone in a private database).
CKModifyRecordsOperation contains a clientChangeTokenData property of type NSData , which is described in the documents as follows:
When you modify records from a fetch operation, specify the data token created by the client using this property to indicate which version of the last record was changed. Compare the data token that you put in the data token in the next record to confirm that the server successfully received the last request to change devices.
I donβt understand why I should worry, given that with every request I get a completion block that tells me if the server successfully received my request. Why do I need to manually compare this client token?
Specifies clientChangeTokenData to properly handle my usage example? I track local data changes and pop everything in the queue every time the data changes. Remote changes are tracked by subscribing to a zone.
If necessary, how can I correctly create this token, given that I have all the change records in CKModifyRecordsOperation ? (using my API for batch operations). What is the overall workflow here?
Thanks.
source share