Google native authentication Issue onConnectionFailed:ConnectionResult SIGN_IN_REQUIRED

I am using GoogleApiClient for google authentication.google user prompt open for login but when select user i am getting error.below i have pasted my code

    protected override void OnCreate (Bundle savedInstanceState)
    {
        base.OnCreate (savedInstanceState);
        SetContentView (Resource.Layout.activity_main);
        if (savedInstanceState != null)
         {
            mIsResolving = savedInstanceState.GetBoolean (KEY_IS_RESOLVING);
            mShouldResolve = savedInstanceState.GetBoolean (KEY_SHOULD_RESOLVE);
        }

        FindViewById (Resource.Id.sign_in_button).SetOnClickListener (this);
        FindViewById (Resource.Id.sign_out_button).SetOnClickListener (this);
        FindViewById (Resource.Id.disconnect_button).SetOnClickListener (this);

        FindViewById<SignInButton> (Resource.Id.sign_in_button).SetSize (SignInButton.SizeWide);
        FindViewById (Resource.Id.sign_in_button).Enabled = false;

        mStatus = FindViewById<TextView> (Resource.Id.status);

        mGoogleApiClient = new GoogleApiClient.Builder (this)
            .AddConnectionCallbacks (this)
            .AddOnConnectionFailedListener (this)
            .AddApi (PlusClass.API)
            .AddScope (new Scope (Scopes.PlusLogin))
            .AddScope(new Scope(Scopes.PlusMe))
            .Build ();

    }

public void OnConnectionFailed (ConnectionResult result)
    {
        Log.Debug (TAG, "onConnectionFailed:" + result);

        if (!mIsResolving && mShouldResolve) {
            if (result.HasResolution) {
                try {
                    result.StartResolutionForResult (this, RC_SIGN_IN);
                    mIsResolving = true;
                } catch (IntentSender.SendIntentException e) {
                    Log.Error (TAG, "Could not resolve ConnectionResult.", e);
                    mIsResolving = false;
                    mGoogleApiClient.Connect ();
                }
            } else {
                ShowErrorDialog (result);
            }
        } else {
            UpdateUI (false);
        }
    }'

`
In OnConnectionFailed method i am getting error onConnectionFailed:ConnectionResult{statusCode=SIGN_IN_REQUIRED, resolution=PendingIntent{366509d: android.os.BinderProxy@bd4c65f}, message=null}
I have attached image where i got error.

Answers

  • mauro_chmixmauro_chmix ITMember

    i have the same problem. How did you solve it? Can you help me? Thanks.

  • Pranav_598Pranav_598 INMember

    @mauro_chmix said:
    i have the same problem. How did you solve it? Can you help me? Thanks.

    I regenerated json file from Firebase Developer console and put in my project.then it works fine.Please make sure that you have generated SH1 Key using command propmt is true.

  • mauro_chmixmauro_chmix ITMember

    @Pranav_598 Thank you, it's work!

Sign In or Register to comment.