Search in sources :

Example 81 with IdpResponse

use of com.firebase.ui.auth.IdpResponse in project quickstart-android by firebase.

the class MainFragment method onSignInResult.

private void onSignInResult(FirebaseAuthUIAuthenticationResult result) {
    IdpResponse response = result.getIdpResponse();
    mViewModel.setIsSigningIn(false);
    if (result.getResultCode() != Activity.RESULT_OK) {
        if (response == null) {
            // User pressed the back button.
            requireActivity().finish();
        } else if (response.getError() != null && response.getError().getErrorCode() == ErrorCodes.NO_NETWORK) {
            showSignInErrorDialog(R.string.message_no_network);
        } else {
            showSignInErrorDialog(R.string.message_unknown);
        }
    }
}
Also used : IdpResponse(com.firebase.ui.auth.IdpResponse)

Aggregations

IdpResponse (com.firebase.ui.auth.IdpResponse)81 Test (org.junit.Test)45 Resource (com.firebase.ui.auth.data.model.Resource)35 AuthCredential (com.google.firebase.auth.AuthCredential)31 InOrder (org.mockito.InOrder)31 FirebaseUiException (com.firebase.ui.auth.FirebaseUiException)22 FirebaseAuthAnonymousUpgradeException (com.firebase.ui.auth.FirebaseAuthAnonymousUpgradeException)19 FirebaseAuthUserCollisionException (com.google.firebase.auth.FirebaseAuthUserCollisionException)19 User (com.firebase.ui.auth.data.model.User)18 FirebaseUser (com.google.firebase.auth.FirebaseUser)15 AuthOperationManager (com.firebase.ui.auth.util.data.AuthOperationManager)12 EmailAuthCredential (com.google.firebase.auth.EmailAuthCredential)11 OnFailureListener (com.google.android.gms.tasks.OnFailureListener)10 OnSuccessListener (com.google.android.gms.tasks.OnSuccessListener)10 AuthResult (com.google.firebase.auth.AuthResult)10 Intent (android.content.Intent)9 Nullable (androidx.annotation.Nullable)9 IntentRequiredException (com.firebase.ui.auth.data.model.IntentRequiredException)9 Task (com.google.android.gms.tasks.Task)9 Application (android.app.Application)8