Check if document synced

Hi
I have a mobile application that uses couchbase lite with a replicator. After saving a document is there any way to check if the document has synced.
I need a way of knowing if my application is actively replicating so that I can warn the user that there may be a delay in their data becoming visible on the server.

My best thought is to maintain a current time document on the server add check that the document is up to date.

Thank you, appreciate the assistance.

@meirrosendorff
You can use AddDocumentReplicationListener in Replicator.

@Sandy_Chuang thank you for the quick response, I see you posted swift code, can I assume the same logic will work for android ?

Yes @meirrosendorff
Please see
https://docs.couchbase.com/mobile/2.8.0/couchbase-lite-android/com/couchbase/lite/AbstractReplicator.html#addDocumentReplicationListener-com.couchbase.lite.DocumentReplicationListener-

1 Like