I have started migrating over from Firebase Realtime Database to Cloud Firestore. I need a way for the app to be alerted to when Firestore's connection state changes, online to offline and vice versa. For clarity, I do not need this written into the Database for other instances of the App to see. This is purely for providing an Indicator to the User that their connection has dropped. In Realtime database I could achieve this by attaching a value listener to the ".info/connected" reference. But It doesn't seem that I can do this in Firestore.
Alternatively, if there is "Pending Updates" value I could listen to in the Firestore Module, that responds to there being data held Offline pending Database sync that would also work.
There is no equivalent to Firebase Realtime Database's
.info/connected
in Cloud Firestore. It's in fact one of the use-cases that is explicitly called on in the blog post comparing Realtime Database and Firestore:The Firestore documentation describes a possible implementation of a presence system by combining Realtime Database and Firestore.