I\'m considering the use of keepSynced()
for some data from Firebase Realtime Database. I understand that it will automatically sync those paths. But how does t
firebaser here
Great question!
When there is no active activity, the operating system may close the connection to the Firebase database at any time. Our SDKs don't try to prevent that, but will reconnect when the app becomes active again.
What you're describing in your second paragraph is what we call "push to sync", where you send a push notification (typically a silent FCM data message) to trigger synchronizing of the data.
We did something like that in last year's I/O app and, while it was a bit more complex than we wanted it to be, it worked great. We explicitly managed the connection in that case, calling goOnline()
and goOffline()
(after 5 minutes iirc). The main sync code can be found in the IOSched github repo.