全新安装/构建后,Android FirebaseAuth getCurrentUser()返回用户 [英] Android FirebaseAuth getCurrentUser() returns user after fresh install/build
问题描述
如果用户之前登录但未注销,则我在应用程序启动时实施了自动登录.我通过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屋!