Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 应用程序更新后的Firebase电话验证_Android_Firebase_Firebase Authentication - Fatal编程技术网

Android 应用程序更新后的Firebase电话验证

Android 应用程序更新后的Firebase电话验证,android,firebase,firebase-authentication,Android,Firebase,Firebase Authentication,我不会粘贴任何代码,因为当用户使用firebase auth中的电话号码创建帐户时,我会收到所需的行为 我的问题是,在应用程序更新后,firebaseUser.getCurrentUser为空,尽管该用户已注册 我的问题: 我如何模仿WhatsApp这样的行为,它不要求用户在每次应用程序更新后都要通过OTP Iv尝试使用authState: auth.addAuthStateListener(firebaseAuth -> { user = firebaseAuth.getCurr

我不会粘贴任何代码,因为当用户使用firebase auth中的电话号码创建帐户时,我会收到所需的行为

我的问题是,在应用程序更新后,
firebaseUser.getCurrentUser
为空,尽管该用户已注册

我的问题: 我如何模仿WhatsApp这样的行为,它不要求用户在每次应用程序更新后都要通过OTP

Iv尝试使用authState:

auth.addAuthStateListener(firebaseAuth -> {
    user = firebaseAuth.getCurrentUser();
      if(user == null)
          signUp()     });

希望更新后的用户不会为空。但在更新应用程序后,它总是空的。

实际上,我没有意识到的是,我试图通过安装和卸载应用程序来模拟更新行为。结果表明令牌凭据在此过程中丢失。我只是假设Firebase以某种方式、某种位置连接到设备标识。我承认我需要一些指令

使用一个。我正是这么做的,但是侦听器返回了一个空用户。您提供的参考没有说明auth如何在没有看到产生这种行为的代码的情况下通过应用程序重新安装(更新)而存活下来,很难说为什么会出现
null
。因此,最好在您的问题中直接提供代码。应用程序更新似乎正在擦除刷新令牌凭据