I use NSPersistentCloudKitContainer
to synchronize data between iOS and macOS. After installing the app, it takes long (sometimes up to an hour) for all data to become available. Related to this, I have a few questions:
-
Synchronization seems only to take place when the app runs in the foreground. Is there a way to keep the app synchronizing when it is brought to the background? I have enabled remote notifications and use
registerForRemoteNotifications
in my app delegate (viaUIApplicationDelegateAdaptor
). I haven't yet experimented with background processing. Should I do that, and can you point me to some references? -
Is there a way to check whether the local-stored data matches what's available on the server? E.g. checking whether a (local-stored)
NSPersistentHistoryToken
matches the latestNSPersistentHistoryToken
on the server. InternallyNSPersistentCloudKitContainer
knows, as I can see log events popping up saying that there are no new data to mirror. I would like to know this to inform the user that synchronization still takes place. Currently, users are complaining about missing data, which is just not available yet.
Thanks!