Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/390.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/209.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
Java Firebase身份验证onPause和onResume(应用程序离开后)不会使用登录视图还原自定义选项卡_Java_Android_Firebase_Firebase Authentication_Android Customtabs - Fatal编程技术网

Java Firebase身份验证onPause和onResume(应用程序离开后)不会使用登录视图还原自定义选项卡

Java Firebase身份验证onPause和onResume(应用程序离开后)不会使用登录视图还原自定义选项卡,java,android,firebase,firebase-authentication,android-customtabs,Java,Android,Firebase,Firebase Authentication,Android Customtabs,我发现firebase身份验证登录提供商(如Microsoft、Yahoo)存在问题 情况是: 按下Microsoft登录按钮后,自定义选项卡将打开。当我尝试登录时,他们会向我发送带有验证码的短信。一旦我打开sms应用程序复制此代码,并且一旦我返回到我的应用程序,带有登录视图的自定义选项卡就会消失 你知道我如何解决这个问题并改进这个登录功能的用户体验的任何解决方案或快速破解方法吗 Task<AuthResult> pendingResultTask = auth.getPen

我发现firebase身份验证登录提供商(如Microsoft、Yahoo)存在问题

情况是: 按下Microsoft登录按钮后,自定义选项卡将打开。当我尝试登录时,他们会向我发送带有验证码的短信。一旦我打开sms应用程序复制此代码,并且一旦我返回到我的应用程序,带有登录视图的自定义选项卡就会消失

你知道我如何解决这个问题并改进这个登录功能的用户体验的任何解决方案或快速破解方法吗

    Task<AuthResult> pendingResultTask = auth.getPendingAuthResult();
    if (pendingResultTask != null) {
        // There's something already here! Finish the sign-in for your user.
        pendingResultTask.addOnSuccessListener(authResult -> {
            // User is signed in.
            // IdP data available in
            // authResult.getAdditionalUserInfo().getProfile().
            // The OAuth access token can be retrieved:
            // authResult.getCredential().getAccessToken().
            // Yahoo OAuth ID token can be retrieved:
            // authResult.getCredential().getIdToken().

            if (authCallback != null) {
                authCallback.onAuthSuccess();
            }
        })
        .addOnFailureListener(e -> {
            // Handle failure.
            showAuthErrorWithMessage(e.getMessage());
            Log.d("Boston", "addOnFailureListener: " + e.getMessage());
        });
    } else {
        // There's no pending result so you need to start the sign-in flow.
        // See below.
        handleAuthSession();
    }
Task PendingSultTask=auth.getPendingAuthResult();
if(pendingreulttask!=null){
//此处已存在内容!请完成用户的登录。
PendingSultTask.addOnSuccessListener(authResult->{
//用户已登录。
//IdP数据可在
//authResult.getAdditionalUserInfo().getProfile()。
//可以检索OAuth访问令牌:
//authResult.getCredential().getAccessToken()。
//可以检索Yahoo OAuth ID令牌:
//authResult.getCredential().getIdToken()。
if(authCallback!=null){
authCallback.onAuthSuccess();
}
})
.addOnFailureListener(e->{
//处理失败。
showAuthErrorWithMessage(如getMessage());
Log.d(“Boston”,“addOnFailureListener:”+e.getMessage());
});
}否则{
//没有挂起的结果,因此需要启动登录流。
//见下文。
handleAuthSession();
}
此代码仅用于演示目的