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?
Asked
Active
Viewed 1,849 times
8
-
1Are 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
-
1On 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 Answers
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