Closed pventura1976 closed 10 years ago
In order to detect the sync has finished just put this delegate method in your AppDelegate.m:
- (void)documentSyncManagerDidFinishSynchronizing:(TICDSDocumentSyncManager *)aSyncManager{
NSLog(@"%@", @"SYNC FINISHED");
//DO WHATEVER YOU WANT HERE
}
Yep, that's just what I did, but I don't know why this method is being called twice!
2014-03-17 15:45:44.080 FlexList[16223:60b] documentSyncManagerDidFinishSynchronizing
2014-03-17 15:45:47.459 FlexList[16223:60b] documentSyncManagerDidFinishSynchronizing
I tried just now with my app and it's called once for every synchronization. Very strange...in your app it seems that the delegate it's called twice.
So I'm doing something wrong. I'll debug a little bit more and post the results. Thanks Renzos for the answer :)
Let us know, in the meantime I'm facing a new strange issue I published an hour ago.
I've found why the App is firing sync process twice. This is due to two reasons:
1.- I'm firing one of them manually:
- (void)documentSyncManagerDidFinishRegistering:(TICDSDocumentSyncManager *)aSyncManager
{
if (self.shouldDownloadStoreAfterRegistering)
{
[aSyncManager initiateDownloadOfWholeStore];
}
else
{
[aSyncManager initiateSynchronization];
}
[aSyncManager beginPollingRemoteStorageForChanges];
}
2.- The 2nd is because TICDS is always finding changes as the app starts; and this is because I'm firing a vacuum process at the start that always has something to fix... :-(
So this is normal. Closing.
Hi all,
Is it normal that documentSyncManagerDidFinishSynchronizing: executes two times?
What I'm trying to do is to show up a message when the background sync is done. Is there a property that I should read to control exactly when the sync has finished?
Regards, Pedro