问题
In my first launching activity there is lines of code that checks if user is logged in by Firebase:
if (mAuth.getCurrentUser() != null) {
startActivity(new Intent(SplashActivity.this, MenuActivity.class));
finish();
}
else
{
startActivity(new Intent(SplashActivity.this, LoginActivity.class));
finish();
}
If user is logged in I open MenuActivity if not then LoginActivity
In my LoginActivity I authorize with signInWithCredential
.
I have found one interesting problem.
When user deletes application then reinstalls it from Google Play and launches it user is still logged in and opens MenuActivity
I have found similar question but with iOS version.
Is it feature of Firebase? How it is possible to invalidate user session when user deletes application?
回答1:
Firebase support answered me and yes Firebase tries to keep some data even if appliaction is deleted.
In order to clear data when deleteing, I needed to disable backuping in my applications manifest in application
:
android:allowBackup="false"
android:fullBackupContent="false"
来源:https://stackoverflow.com/questions/44042337/android-firebase-auth-user-session-still-exists-when-user-deletes-and-reinstal