0

I trying check user if logged already or not but the problem this method getLastSignedInAccount return not null rather null before press login button

if (GoogleSignIn.getLastSignedInAccount(SplashScreen.this) != null) {
    Toast.makeText(this, "google", Toast.LENGTH_SHORT).show();
}
if (AccessToken.getCurrentAccessToken() != null) {
    Toast.makeText(this, "facebook", Toast.LENGTH_SHORT).show();
}

I never sign in yet then should be return null , the facebook has same problem

  • Please have a look at this thread, https://stackoverflow.com/a/50919549/5701085 – Asad Ali Choudhry Jun 09 '19 at 13:39
  • @AsadChoudhary I tried that way already , that function return to me true this mean user already logged but I never log-in yet –  Jun 09 '19 at 13:43
  • if you logged in once, and install App again, it will still consider you logged in. You can uninstall the App and install again to see you logged out. – Asad Ali Choudhry Jun 09 '19 at 13:45
  • I reinstall already yesterday but same problem , I think google and facebook use sharedpreferences stay saved until after reinstall –  Jun 09 '19 at 13:47
  • Yes google and facebook use sharedpreferences stay saved after delete app , I called sign-out method , It's working now thank you –  Jun 09 '19 at 13:52
  • Okay great, but FYI, if we uninstall the App, All the SharedPreferences of the App are cleared. – Asad Ali Choudhry Jun 09 '19 at 13:56

0 Answers0