Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/184.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/7/elixir/2.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 Facebook AccountKit出现Firebase身份验证错误_Android_Firebase_Firebase Authentication_Facebook Authentication_Account Kit - Fatal编程技术网

Android Facebook AccountKit出现Firebase身份验证错误

Android Facebook AccountKit出现Firebase身份验证错误,android,firebase,firebase-authentication,facebook-authentication,account-kit,Android,Firebase,Firebase Authentication,Facebook Authentication,Account Kit,通过Firebase身份验证使用AccountKit的电话验证有效吗? (代替firebase支持的facebook身份验证) 使用此代码: private void handleFacebookAccessToken() { AccessToken accessToken = AccountKit.getCurrentAccessToken(); String TAG = "TokenOperation"; Log.d(TAG, "handleFacebookAc

通过Firebase身份验证使用AccountKit的电话验证有效吗? (代替firebase支持的facebook身份验证)

使用此代码:

 private void handleFacebookAccessToken() {

    AccessToken accessToken = AccountKit.getCurrentAccessToken();

    String TAG = "TokenOperation";
    Log.d(TAG, "handleFacebookAccessToken:" + accessToken);

    AuthCredential credential = FacebookAuthProvider.getCredential(accessToken.getToken());
    mAuth.signInWithCredential(credential)
            .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
                @Override
                public void onComplete(@NonNull Task<AuthResult> task) {
                    if (task.isSuccessful()) {
                        // Sign in success, update UI with the signed-in user's information
                        Log.d("", "signInWithCredential:success");
                        FirebaseUser user = mAuth.getCurrentUser();
                        Toast.makeText(DetailsInputDialog.this, "Firebase:" + user.getUid(), Toast.LENGTH_LONG).show();
                    } else {
                        // If sign in fails, display a message to the user.
                        Log.w(TAG, "signInWithCredential:failure", task.getException());
                        Toast.makeText(DetailsInputDialog.this, "Authentication failed.",
                                Toast.LENGTH_SHORT).show();
                    }
                    // ...
                }
            });
}
private void handleFacebookAccessToken(){
AccessToken AccessToken=AccountKit.getCurrentAccessToken();
String TAG=“TokenOperation”;
Log.d(标记“handleFacebookAccessToken:+accessToken”);
AuthCredential credential=FacebookAuthProvider.getCredential(accessToken.getToken());
mAuth.SIGNWITH凭证(凭证)
.addOnCompleteListener(这是新的OnCompleteListener(){
@凌驾
未完成的公共void(@NonNull任务){
if(task.issusccessful()){
//登录成功,使用登录用户的信息更新UI
Log.d(“,”带凭证的登录:成功”);
FirebaseUser=mAuth.getCurrentUser();
Toast.makeText(DetailsInputDialog.this,“Firebase:+user.getUid(),Toast.LENGTH\u LONG.show();
}否则{
//如果登录失败,则向用户显示消息。
w(标记“signInWithCredential:failure”,task.getException());
Toast.makeText(DetailsInputDialog.this,“身份验证失败”,
吐司。长度(短)。show();
}
// ...
}
});
}
考虑到accessToken不为null,firebase身份验证失败时会出现错误:

发生内部错误。[无效的访问令牌,错误代码43。]


您是否已在firebase dashboard中启用facebook登录?是的,我已。。。。。