Is there any way to check the current sync status when using Atlas Device Sync in Swift?
I’m looking for an ability to:
- Wait for all pending synchronization tasks to finish
- Show a connection status to the user (e.g. “Connected to Atlas”)
- Show a sync status to the user (e.g. “Synchronizing”)
- Show the date of the last synchronization to the user
I’m currently trying to determine the status using
syncSession.publisher(for: \.connectionState)
and
syncSession.addProgressNotification(for: .download, mode: .forCurrentlyOutstandingWork)
but that doesn’t seem to be reliable (the app sometimes incorrectly thinks it’s connected/synchronized).