8

I want to sign out the user (using Firebase) when the app is deleted so the user is not already logged in when the app is reinstalled. Is there a way to achieve this?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Juju
  • 439
  • 3
  • 18
  • 1
    Are you saying the user is still signed in when you restart the app? If that is the case, it'd help to know on what platform you're seeing this. – Frank van Puffelen Mar 06 '20 at 14:20
  • Exactly, the user is still signed in when the app is reinstalled and launched for the first time. I'm using Flutter and I would like to implement this for both iOs and Android. – Juju Mar 06 '20 at 14:50
  • 1
    On iOS this is expected behavior, as the user information is stored in the iOS keychain. Here's one older answer I could quickly find about it: https://stackoverflow.com/questions/40733262/log-user-out-after-app-has-been-uninstalled-firebase. More results here: https://stackoverflow.com/search?q=%5Bfirebase-authentication%5D+keychain+reinstall – Frank van Puffelen Mar 06 '20 at 15:06
  • No way to directly implement this in my flutter project? – Juju Mar 06 '20 at 15:41

1 Answers1

4

What I would do is save a isFirstAppStartup in SharedPreferences. And if it is the first app startup then you just signout the user from firebase.

anonymous-dev
  • 2,897
  • 9
  • 48
  • 112