I have implemented Google Signing for Android app. The user can successfully login from the Google Login Button.
This screen appears while selecting a Social Account : 1
So now the user has logged in successfully by selecting his/her account.
Now, user logs out and tries to sign in again by using Google Login Button.
At this time, he is not asked with the option to choose account , he is automatically logged in using the account he/she selected at the first time.
At the time of logout what should I do to clear the cache of selected account.
On your Android phone or tablet, go to myaccount.google.com. In the top right, tap your profile photo or name. Sign out. Sign in with the account you want to use.
Switch between accounts On your computer, sign in to Google. On the top right, select your profile image or initial. On the menu, select the account you'd like to use.
On a browser, like Chrome On your computer, sign in to Google Docs, Sheets, or Slides. In the top right, click your profile photo or email address. Click the account you want to use.
Step 1: Open the Gmail app on your Android device. You should already be signed in to your first account. Step 2: To add your other accounts, tap on the Profile Picture icon in the top-right corner. Step 3: Select Add Another Account.
In firebase documentation for android, they only refer to use this:
Firebase.auth.signOut()
However, next time the user logs in, the app will automatically select the previous email. To avoid this, you should use the follow code as well:
googleSignInClient.signOut()
As you didn't provide any code or reference how you are logging in and logging out, it might be that you incorrectly sign out user from the app.
So here is what docs describe one should do on user logout: https://developers.google.com/identity/sign-in/android/disconnect
Sign out:
Auth.GoogleSignInApi.signOut(mGoogleApiClient).setResultCallback(
new ResultCallback<Status>() {
@Override
public void onResult(Status status) {
// ...
}
});
Note: You must confirm that GoogleApiClient.onConnected has been called before signing out.
Also check status
which comes in onResult
- maybe there is some error, which might lead to the answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With