Force sync when Replicator is offline

Hi all,
I am seeing an issue in my Xamarin iOS mobile app where the CB Lite replicator status goes to Offline after the application has been backgrounded/idle for a while (around half a day or more). The connection is configured as a continuous push and pull. Upon relaunching the app, even while connected to a strong wifi connection, the status does not appear to update to any of the active states (Connecting or Busy). Is it sufficient to call Start() on the replicator or what is the best way to handle this and force the replicator to begin syncing? Also for what it’s worth, I was testing on an iPad simulator to make debugging easier. But I would think on a device would be the same, and based on complaints from users due to un-synced/lost data I think this is the issue.

Thanks

On Xamarin iOS you need to clean up replication when going into the background. We are working on making the documentation clearer about this but the recommended action is to stop replication when going into the background (or try to imitate what the Swift library does). Having this behavior be automatic is being considered but it’s tricky because of the number of platforms .NET spans.

Thanks @borrrden. Here’s the logic we’re adding for when the app is backgrounded:
{
_replicator.Stop();
_replicator.RemoveChangeListener(_replicatorListenerToken);
_replicator = null;
}

If data was not yet synced to the Couchbase db prior to invoking this, will it be lost during the next sync when we’re using a new replicator? Or should we just be calling _replicator.Stop() here?

No, data will not be lost in any case as the replicator keeps track of its progress through a series of checkpoints. If anything there will be some redundant back and forth during the next start of the replicator.