How to make a user sign out in Firebase?

前端 未结 13 1642
猫巷女王i
猫巷女王i 2020-12-15 04:22

I am making a simple authentication app in Android using Firebase authentication. Till now I am successful in signing the user in, however the issue is that the user remains

13条回答
  •  猫巷女王i
    2020-12-15 05:01

    FirebaseAuth.getInstance().signOut();
    

    Then, to detect the sign-in status:

    private FirebaseAuth mAuth = FirebaseAuth.getInstance()
    public static boolean mAuthSignIn() {
        if (mAuth != null) {
            FirebaseUser user = mAuth.getCurrentUser();
            return user != null;
        }
        return false;
    }
    

提交回复
热议问题