How To Logout User From Firebase Database?
I'm using firebase database using firebaseUser authorisation. I successfully logout user from app, but when I logout user the app is crashed due to firebase database reference. I g
Solution 1:
You don't logout from the "database" as such, but logout from Firebase with FirebaseAuth.getInstance().signOut()
.
After that, the user can't access parts of the database that requires user credentials, and I guess it's the reason why your app crashed. So when you make database calls, you need to check if the user has correct credential.
Solution 2:
I added ValueEventListener to firebase database reference, when i'm trying to logout the user ValueEventListener is still running in background that's why my app is crashing.
I removed ValueEventListener from firebase database reference and my problem is solved.
Post a Comment for "How To Logout User From Firebase Database?"