Skip to content Skip to sidebar Skip to footer

Firebase Not Working. Android

I was trying to register an user but it didn't work. When I check the console.firebase the user has not been created. Here is my code: //registering firebaseAuth.createUse

Solution 1:

Seems like you have not added the listeners:

privateFirebaseAuth.AuthStateListener mAuthListener;

mAuthListener = newFirebaseAuth.AuthStateListener() {
@OverridepublicvoidonAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
    FirebaseUser user = firebaseAuth.getCurrentUser();
    if (user != null) {
        // User is signed inLog.d(TAG, "onAuthStateChanged:signed_in:" + user.getUid());
    } else {
        // User is signed outLog.d(TAG, "onAuthStateChanged:signed_out");
    }
    // ...
}
};

@OverridepublicvoidonStart() {
super.onStart();
mAuth.addAuthStateListener(mAuthListener);
}

@OverridepublicvoidonStop() {
super.onStop();
if (mAuthListener != null) {
    mAuth.removeAuthStateListener(mAuthListener);
}
}

Plesae follow the complete tutorial at https://firebase.google.com/docs/auth/android/start/

Post a Comment for "Firebase Not Working. Android"