I am working on a goals app and storing with Firebase Realtime Database. Everything works fine until I close the app and open it again.
I am still logged in, but I can’t update the database through my app as I could when I first logged in.
How do you know you are still logged in to Firebase? Are there app variables you are using that should instead be stored variables so that they save their values when you re-open the app?
I guess I don’t know. I store everything either as stored or cloud variables. I don’t tell Firebase to log out unless a button is clicked. My sign in blocks say as long as there’s not an error passed, and the email is verified, store the user ID as a stored variable, and make a stored variable isLoggedIn to true so they stay logged in from my app’s perspective until they click the log out button.
Firebase use session token to identify logged in users so whenever the user closes the app, the session token is destroyed.
One way is to use the stored user name and password and automatically log the user in next time the app is used and the IsLoggedIn is set to true. This way a new session token will be established so you can access Firebase Realtime DB.