iCloud Sync NSPersistentCloudKitContainer: Make use of BGProcessingTaskRequest to catch up?

Hi,

I have implemented iCloud Sync using NSPersistentCloudKitContainer. However, I have a lot of data to sync in my use case which can take quite some time (minutes) especially when starting with a new device (10's of minutes).

I was wondering if there is a way to make good use of BGProcessingTaskRequest (ie long running task over night, potentially with requiresExternalPower). The idea is to let the device catch up with the remote store during such a long running background task over night/during charge.

I already tried to hack my way into this by trying to just listen to sync events during the task and not finish the task until sync events have stopped but it seems the sync processor does have its own awareness of the app moving to the background and therefore might not even wake up during the background task.

Any idea how I can help the CloudKitContainer to catch up in the background with very large workloads?

Thanks!

Post not yet marked as solved Up vote post of scurra Down vote post of scurra
421 views