I have an app using Firebase as backend. My App implements Firebase-Authentication API using simple Email and Password login for authenticating.
Everything works fine except for one issue. I would like to maintain the user session even after a user closes the App.
FIRAuth.auth()?.currentUser? has all the user properties (ex: uid, email, token etc...) for the current user which works great. The problem I noticed is that FIRAuth.auth()?.currentUser? is not persistent. So after exiting the app and launching again, it returns null.
I would not like to ask a user every time they open the app to login again. Is there a way around this?
addAuthStateDidChangeListener
(see the Firebase Authentcation documentation). If that's not the problem, post the minimum complete code that reproduces the problem. – Frank van Puffelen