Here’s my scenario:
- User signs-in online
- Device goes offline
- User adds/modifies objects in local app DB
- User expects a UX/UI in app to indicate there is pending data waiting to sync.
Tried:
let session = appSession.userRealm?.syncSession
uploadToken = session?.addProgressNotification(for: .upload,
mode: .reportIndefinitely) { progress in
DDLogVerbose("sync progress (.upload): \(progress.fractionTransferred*100.0)")
if progress.isTransferComplete {
self.uploadToken?.invalidate()
}
}
Nothing happens.
How can I poll the current state of sync progress?