Im trying out couchbase lite and listener (1.3.1) for local storage and peer transfer for my POC in iOS
POC details:
1.One device will have the data (through json parsing offline) and other device will just have an empty database.
2.Through bonjour protocol, identify my nearby devices
3.Once the service is identified, resolving the sender address, and creating a push replication with that URL
CBLManager *cblManager = [CBLManager sharedInstance] ;
self.database = [cblManager existingDatabaseNamed:dbName error:&error];
CBLReplication *push = [self.database createPushReplication:self.syncUrl];
[[NSNotificationCenter defaultCenter] addObserver:self selector: @selector(trackSyncProgress:) name:kCBLReplicationChangeNotification object:push]];
push.continuous = true;
[push start];
4.Getting input and output stream from sender in the delegate (netServiceDidResolveAddress) and replication starts
Problems facing:
Above steps are all working fine only for the first time,as soon as the service is identified,replication starts and all the documents are saved onto the remote peer
If i do offline changes (like adding a document/deleting a document )after initial transfer ,those changes are not getting transferred, logs are also not getting printed
CBLDatabase *cblDatabase = [DBHandler getSharedDataBase:KDataBaseName];
CBLDocument *document = [cblDatabase documentWithID:[NSString stringWithFormat:@"%@%@%@",@“27313”,[NSStringFromClass([CCNotes class]),[dictDetails objectForKey:@“NotesId”]]];
Notes *notes = [Notes modelForDocument:document];
notes.notes = [dictNotes objectForKey:@“comments”];
notes.docType = NSStringFromClass([Notes class]);
notes.id = [dictDetails objectForKey:@“NotesId”]
[notes save:&error];
All the offline changes are happening in a background thread
why my offline changes are not getting transferred to peer,though the replication is continuous?
Please guide me on this issue