I am very close to finishing my OBX Sync project, but i need some answers to finish it.
- How can i restart sync? (for example the server IP address changes in the background, ). Currently i have to restart the whole app, to restart sync.
- How can i determine, when OBX finished sync on login? I will control the UI, and let show / control the user that all data are up-to-date / sync in progress. For example: user A went on vacation, and in the meantime his permissions are revoked. Since the user’s device was not connected to the server, these changes were not synced locally. When the user logs in again, during the synchronization the user’s data may be synchronized later than when he logged in, so he can log in even if he no longer exists on the server.
Thanks
2
Answers
Code for start sync is:
the debug messages on start the app after startSync() started:
As you can see, the event runs after each data sync (After each piece of data, you see "Sync event fired", which, if you look at the code, is in the completionEvent.listen procedure. In this case, how can i be sure, if sync is finished, or still running?
To restart a SyncClient after a configuration change, please close it and create a new instance. Assuming you have an existing SyncClient instance called
syncClient
, it should look something like this:For the second question, I think there are some listeners mentioned in the docs:
Hope that helps.