I've been going through the Firebase docs to set up a user authentication system in my android app. For some reason however, it doesn't look like any of the callbacks are running on my FirebaseAuth object!
For example with setting up the Facebook authentication as instructed here
private void handleFacebookAccessToken(AccessToken token) {
Log.d("AUTH", "handleFacebookAccessToken:" + token.getToken());
// ...
AuthCredential credential = FacebookAuthProvider.getCredential(token.getToken());
Log.d("AUTH", "Credential: "+credential);
mAuth.signInWithCredential(credential)
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
Log.d("AUTH", "signInWithCredential:onComplete:" + task.isSuccessful());
// If sign in fails, display a message to the user. If sign in succeeds
// the auth state listener will be notified and logic to handle the
// signed in user can be handled in the listener.
if (!task.isSuccessful()) {
Log.w("AUTH", "signInWithCredential", task.getException());
Toast.makeText(LoginActivity.this, "Authentication failed.",
Toast.LENGTH_SHORT).show();
}
// ...
}
});
}
Everything fine on the part of Facebook but when it comes to signing in with the retrieved fb credentials, the signInWithCredential function doesn't run any callbacks and nothing seems to happen in my user database.
Furthermore I've tried the much more simpler
mAuth.createUserWithEmailAndPassword(etUserID.getText().toString(), etPassword.getText().toString());
and nothing happens as well. I've enabled both providers in my Firebase console and downloaded the latest google-services.json file for the project. Am I missing something?
EDIT: Just tried running the quick-start authentication demo and it doesn't work as well. I do see on my emulator that this app won't run unless I update google services. Is this the cause of this error? I tried updating google services on various emulators and that just returns an error.