Android,Firebase身份验证,用户会话仍然存在,当用户删除并重新安装应用程序 [英] Android, Firebase Auth, user session still exists when user deletes and reinstall app

查看:216
本文介绍了Android,Firebase身份验证,用户会话仍然存在,当用户删除并重新安装应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的第一个启动活动中,有一些代码行用于检查用户是否已通过Firebase登录:

  if .getCurrentUser()!= null){
startActivity(new Intent(SplashActivity.this,MenuActivity.class));
finish();
}
else
{

startActivity(new Intent(SplashActivity.this,LoginActivity.class));
finish();





$ p如果用户登录,我打开 MenuActivity if LoginActivity


$ b 在我的 LoginActivity 中,我使用 signInWithCredential

我发现了一个有趣的问题。



当用户删除应用程序,然后从Google Play重新安装并启动它用户仍然登录并打开MenuActivity



我发现了类似的问题问题/ 27893418 / firebase-deletion-and-reinstalling-app-does-not-un-authenticate-a-user>但是iOS版本

< Firebase的功能是什么?
当用户删除应用程序时,如何使用户会话无效?

解决方案

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"

这篇关于Android,Firebase身份验证,用户会话仍然存在,当用户删除并重新安装应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆