Firebase Login Error (FirebaseNetworkException)

300 views
Skip to first unread message

박인환

unread,
Jan 20, 2017, 10:55:58 AM1/20/17
to Firebase Google Group
mCustomToken = receiveToken;

mAuth.signInWithCustomToken(mCustomToken).addOnCompleteListener(new OnCompleteListener<AuthResult>() {

@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if(!task.isSuccessful()) {
Log.w(LOG_TAG, "signInWithCredential", task.getException());
}
FirebaseUser user = task.getResult().getUser();

if (user != null) {
// User is signed in
Log.d(TAG, "onAuthStateChanged:signed_in1:" + user.getUid() + " / " + user_email + " / " + user_name + " / " + user_profile_image );

//insert shared preference
SharedPreferences pref = getSharedPreferences("bebr_user", MODE_PRIVATE);
SharedPreferences.Editor editor = pref.edit();
editor.putString("user_custno", user.getUid().replaceAll("bebranch#",""));
editor.putString("user_email", user_email);
editor.putString("user_name", user_name);
editor.putString("user_profile_image", user_profile_image);
editor.commit();

Intent intent = new Intent(getApplicationContext(), MainActivity.class);
startActivity(intent);

showProgress(false);
finish();

} else {
// User is signed out
Log.d(TAG, "onAuthStateChanged:signed_out1");
}
}
});

getting error on FirebaseUser user = task.getResult().getUser();

com.google.firebase.FirebaseNetworkException: A network error (such as timeout, interrupted connection or unreachable host) has occurred.
                                                                                     at com.google.android.gms.internal.zzahe.zzfc(Unknown Source)
                                                                                     at com.google.android.gms.internal.zzahb$zzg.zza(Unknown Source)
                                                                                     at com.google.android.gms.internal.zzahm.zzfd(Unknown Source)
                                                                                     at com.google.android.gms.internal.zzahm$zza.onFailure(Unknown Source)
                                                                                     at com.google.android.gms.internal.zzahh$zza.onTransact(Unknown Source)
                                                                                     at android.os.Binder.execTransact(Binder.java:453)

weird thing is some device is working and some device is gettting error

I'm very sure my every device well connected to internet,  quiet sure internet connection is not a problem



Reply all
Reply to author
Forward
0 new messages