全新安装/构建后,Android FirebaseAuth getCurrentUser()返回用户 [英] Android FirebaseAuth getCurrentUser() returns user after fresh install/build

查看:67
本文介绍了全新安装/构建后,Android FirebaseAuth getCurrentUser()返回用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果用户之前登录但未注销,则我在应用程序启动时实施了自动登录.我通过FirebaseAuth.getInstance().getCurrentUser()

I implemented an auto-login on my app's start, if the user signed in before and did not log-out. I do this via FirebaseAuth.getInstance().getCurrentUser()

现在,我将构建debug-apk并将其安装在我的物理Android手机上. getCurrentUser()返回我在Android模拟器上使用的最后一个用户.我真的不希望这种情况发生.

Now I build the debug-apk and install this on my physical Android phone. getCurrentUser() returns the last user I used on the Android emulator. I really don't want this to happen..

有没有人知道如何预防这种情况? 还是FirebaseAuth为什么要这样做?

Has anyone an idea how to prevent this ? Or why is FirebaseAuth doing this ?

谢谢!

推荐答案

事实证明,FirebaseAuth从我的Android设备上获取了已登录的Google帐户. 我在设置中将其删除,getCurrentUser()返回null

So it turned out, that FirebaseAuth took the signed in Google account from my Android device. I removed it in the settings, and getCurrentUser() returned null

这篇关于全新安装/构建后,Android FirebaseAuth getCurrentUser()返回用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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