Replication is active only during the initial transfer (it is not actve continuously)

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

All the offline changes are happening in a background thread

Are you following the concurrency guidelines in the docs? You can’t use the same CBL instances from the main thread on a background thread, as they’re not thread-safe. You have to create new instances for use on that thread.

Thanka jens. Yes i did. I am creating new database instance whenever i do
background operation. This is how im saving my newly created document in
the detached thread.

CBLManager *manager = [[CBLManager SharedInstance] copy] ;
CBLDatabase cblDatabase = [manager databaseNamed:@’‘couchdb’'
error:&error] ;
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] ;

Pls let me know if anything has to be modified. Thanks

Have you checked all the calls that might fail, especially [notes save:&error]?

The best way to troubleshoot this is to turn on some logging. In the scheme editor you can add command line args -Log YES and -LogSync YES.