Firebase注销无效 [英] Firebase logout is not working

查看:248
本文介绍了Firebase注销无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开始使用Firebase,但我的经验是可怕的。



我不能注销用户



我已经尝试了不同的事情,花了我所有的4天,以找出如何注销用户,但没有明确的选择。

我想完全唱出用户他们可以选择另一个Gmail账户。



我已经尝试了下面的代码:

  FirebaseUser user = firebaseAuth.getCurrentUser(); 
user.unlink(user.getProviderId()); 。FirebaseAuth.getInstance()signOut();

里面的

  mAuth = FirebaseAuth.getInstance(); // mAuth.signOut(); 
// auth fail olarsa mAuth.signOut(); sil sonra yerne qoy
mAuthListener = new FirebaseAuth.AuthStateListener(){
@Override
public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth){
pre>

我也试过这个:从Android应用程序正确注销用户

解决方案

您使用的版本比我怀疑他们引入了一个新的bug。您之前提到 NullPointerException ,所以我建议您确保您传递给 Auth.GoogleSignInApi.getSignInIntent 的GoogleApiClient不为null 。


I have begin to use Firebase but my experience is terrible.

I cannot sign out user.

I have tried different things and spend all my 4 days to figure out how to sign out user but there is not clear option.

I want to sing out user totally so they can select another gmail account .

I have tried below code:

FirebaseUser user = firebaseAuth.getCurrentUser();
user.unlink(user.getProviderId()); FirebaseAuth.getInstance().signOut();

inside of

mAuth = FirebaseAuth.getInstance();//mAuth.signOut();
        //auth fail olarsa mAuth.signOut(); sil sonra yerne qoy
        mAuthListener = new FirebaseAuth.AuthStateListener() {
            @Override
            public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {

I have tried also this:Properly log out a user from android app

解决方案

You are using a newer version than me, I doubt they introduced a new bug. You mentioned NullPointerException earlier, so I suggest you make sure the GoogleApiClient you pass to Auth.GoogleSignInApi.getSignInIntent is not null.

这篇关于Firebase注销无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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