NSURL* newRemoteURL = [NSURL URLWithString:syncUrl];
if (newRemoteURL) {
_pull = [database createPullReplication:newRemoteURL];
CBLReplication *push = [database createPushReplication:newRemoteURL];
NSNotificationCenter* nctr = [NSNotificationCenter defaultCenter];
[nctr addObserver:self selector: @selector(replicationProgress1:)
name: kCBLReplicationChangeNotification object: _pull];
_pull.continuous = YES;
if (!kSyncGatewayWebSocketSupport) {
_pull.customProperties = @{@"websocket": @NO,@"normal": @YES};
}
[_pull start];
}
- (void)replicationProgress1:(NSNotification*)n
{
Bool active = (_pull.status == kCBLReplicationActive)
}
I have tried everything but couldnt succeed .Please help me out as I need to call my function when replication stops.