Firebase Facebook身份验证对我来说无法正常工作 [英] Firebase facebook authentication is not working properly for me

查看:60
本文介绍了Firebase Facebook身份验证对我来说无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Firebase UI在我的应用程序中开发fb身份验证.一切正常,但是当我尝试从其他帐户登录时,它会继续滚动并进入以前的状态,好像什么也没发生.Fb登录仅适用于我的帐户,我从该帐户登录到developer.facebook.com并使用了凭据.那么,是否有任何选项可以使fb登录到我的所有用户?这是我的代码.

I used Firebase UI for developing fb authentication in my app. Everything works smooth but when i try to login from other accounts it keeps on scrolling and gets to previous state as if nothing happened. Fb login only works with my account, the same account from which i login to developer.facebook.com and used credentials. So is there any option to enable fb login to all my users?. Here is my code.

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    private FirebaseAnalytics mFirebaseAnalytics;
    private FirebaseAuth mAuth;
    private static final int RC_SIGN_IN = 0;



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        // Obtain the FirebaseAnalytics instance.
        mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
        mAuth = FirebaseAuth.getInstance();
        if(mAuth.getCurrentUser()!=null)
        {
            Log.d("AUTH",mAuth.getCurrentUser().getEmail());
            //user already signed in
        }else {
            startActivityForResult(
                    AuthUI.getInstance()
                            .createSignInIntentBuilder()
                            .setAvailableProviders(Arrays.asList(
                                    new AuthUI.IdpConfig.EmailBuilder().build(),
                                    new AuthUI.IdpConfig.GoogleBuilder().build(),
                                    new AuthUI.IdpConfig.FacebookBuilder().build()))
                            .build(),
                    RC_SIGN_IN);
        }
        findViewById(R.id.log_out_button).setOnClickListener(this);
    }
    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if(requestCode==RC_SIGN_IN){
            if(resultCode==RESULT_OK){
                //user logged in
                Log.d("AUTH",mAuth.getCurrentUser().getEmail());
            }
            else {
                //user not authenticated
                Log.d("AUTH","NOT AUTHENTICATED");
            }
        }
    }

    @Override
    public void onClick(View view) {
        if(view.getId()==R.id.log_out_button)
        {
            AuthUI.getInstance()
                    .signOut(this)
                    .addOnCompleteListener(new OnCompleteListener<Void>() {
                        @Override
                        public void onComplete(@NonNull Task<Void> task) {
                            Log.d("AUTH","USER LOGGED OUT");
                            finish();
                        }
                    });
        }
    }
}

推荐答案

好,我得到了答案.在剑桥分析之后,除非您的应用程序在Play商店中上线,否则您无法公开使用fb登录.您仍然可以在开发人员模式下测试登录功能.那就是为什么只有我才能登录其他人.为了让其他人使用,您必须将它们添加为developer.facebook.com中的测试者.如果您的应用程序已经上线并且想要添加此类功能,还请确保先更新隐私权政策网址.

Ok i got the answer. After that cambridge analytica you cannot use fb login publically unless your app is live on play store. You can still test the login functionality in developer mode. Thats why only i am able to login not others. For others to use you have to add them as tester in developer.facebook.com . Also make sure to updated privacy policy url first if your app is live and wants to add such functionality.

这篇关于Firebase Facebook身份验证对我来说无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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