Firebase logout is not working

后端 未结 3 1527
猫巷女王i
猫巷女王i 2021-01-21 23:44

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 si

3条回答
  •  猫巷女王i
    2021-01-22 00:27

    If you check the Firebase Auth Quickstart sample code, the sign-out for Google provider includes these steps.

    Are you calling Auth.GoogleSignInApi.signOut() when you sign-out? So, please use this code:

    private void signOut() {
        // Firebase sign out
        mAuth.signOut();
    
        // Google sign out
        Auth.GoogleSignInApi.signOut(mGoogleApiClient).setResultCallback(
            new ResultCallback() {
                @Override
                public void onResult(@NonNull Status status) {
                    //do what you want
                }
            });
    }
    

提交回复
热议问题