Reputation: 1
My app creates a user and stores his id and display name in the firebase realtime database as key and value. I'm trying to find out if I can check if I am connected to the service before letting the user access the app. (My server has a check-health function that just responds with {status:healthy}, I'm looking for something similar to that). Thanks in advance!
P.S: From what I understand, firebase realtime database and firebase authentication are different services, and so "checking health" for each one would probably be a different process.
Upvotes: 0
Views: 27
Reputation: 138969
From what I understand, Firebase Realtime Database and Firebase Authentication are different services.
Yes, that's correct. The Firebase Realtime Database and Firebase Authentication are two different Firebase products that can work independently of each other.
And to answer your question:
How can I check I have established a connection with Firebase services?
If you're referring to Firebase Authentication, please note that this particular Firebase Product does not maintain a persistent connection between the client (your app) and the Firebase servers. This means that the sign-in operation is a one-time request and right after your app can also work while offline.
When it comes to the Firebase Realtime Database, you can have a persistent connection to the Firebase servers, and you can also detect the connection state as mentioned in the official documentation:
Upvotes: 0