且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Android,Firebase身份验证,用户会话仍然存在,当用户删除并重新安装应用程序

更新时间:2023-12-05 17:24:16

Firebase支持回答了我的问题,并且Firebase尝试保留一些数据,即使appliaction被删除。 b

为了在删除数据时清除数据,我需要在 application 应用程序清单中禁用备份:

  android:allowBackup =false
android:fullBackupContent =false


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?

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"