I have an issue where I am using google sign in for my application + Firebase.
Suppose there are 3 users X,Y and Z
with whom I am login in my application at one instance of time.
My code for checking the user is logged in or not:
FirebaseAuth mAuth = FirebaseAuth.getInstance();
FirebaseUser currentUser = mAuth.getCurrentUser();
if(currentUser!=null)
{
//user logged in and get user detail from currentUser and go to HomePage
}
else{
//Show sign in button
}
Scenario : I signed it with multiple accounts and logged out. everything working fine.
But when I delete the application and again install it. The Y
user is automatically return by mAuth.getCurrentUser()
.
I tried login with X
and Uninstall the application.
Still, if I install it again it directly takes me to Y
user.
I tried login with Z
and Uninstall the application.
Still, if I install it again it directly takes me to Y
user.
I even tried login out and Delete the application. Again if I install, it returns Y
user without even asking for sign in.
NOTE : I havent cleared cache or data . If I do that everything works fine.
The issue is just unistalling the app.
What must be the reason ?