Open xsown opened 11 years ago
The iCloud syncing is based on the file syncing mechanisms provided by iOS. You can't pause that one.
The iCloud syncing works like the file syncing as it only produces files in a certain directory. Besides that it only uses the NSMetadataQuery
(in TIUbiquityMonitor
) for checking if files have changed and need to be loaded (only needed on iOS as iOS doesn't load files automatically).
So, TL;DR: you don't need to pause anything when using iCloud sync. You can however deactivate the TIUbiquityMonitor
. (I am planing to include the functionality of that class into the TICDSiCloudDocumentManager
).
Thanks for your reply :)
1.) Yes, you're right. It's currently not used by the iCloud classes. I start it in my app as soon as the sync starts. And also use it early on a new device with a special NSPredicate
to priorize the download of the whole store.
My idea would be to merge the functionality of that class into the TICDSiCloudDocumentManager
to replace the directory watcher and use the NSMetadataQuery
to identify new files / changes.
2.) There is a switch burried deep down in the iCloud Settings -> Documents and Data that is called (something like) "Use mobile data" (my iPhone is German so I don't know the English name). Isn't that doing what you're thinking about?
I am using the iCloud branch of TICDS in my project. I found that the TICDSFileManagerBasedDocumentSyncManager has 2 methods [beginPollingRemoteStorageForChanges] and [stopPollingRemoteStorageForChanges], while the TICDSiCloudBasedDocumentSyncManager has only [enableAutomaticSynchronizationAfterChangesDetectedFromOtherClients]. I'm trying to provide a wifi-only sync feature, as the syncing mechanism will automaticlly paused when the network is switching to WWAN or completely shutdown (airplane mode, etc), but I want to preserve the app sync manager and doc sync manager configured to keep generating sync change files for future syncing. So the questions are:
Thank you!