How to login with Google in Xamarin ios

Hi All,

I am working on Xamarin.iOS for sign in with google.
I tried Xamarin.Auth OAuth2Authenticator
var Auth = new OAuth2Authenticator(
"720081367695-qqqqqq11111111ptmlura6bgde.apps.googleusercontent.com",
"2Am5qdd11111111111q8YP",
"email",
new Uri("https://accounts.google.com/o/oauth2/auth"),
new Uri("https://wwwww.net/oauth2callback"),
new Uri("https://www.googleapis.com/oauth2/v3/token")
);
//PresentViewController(auth.GetUI(), true, null);
Auth.Completed += async (sender, eventArgs) =>
{
DismissViewController(true, null);

                            if (eventArgs.IsAuthenticated)
                            {
                                //var request = new OAuth2Request("GET", new Uri(), null, eventArgs.Account);
                                //var response = await request.GetResponseAsync();
                                //var fbUser = JObject.Parse(response.GetResponseText());

                                //var id = fbUser["id"].ToString().Replace("\"", "");
                                //var name = fbUser["name"].ToString().Replace("\"", "");
                                //var email = fbUser["email"].ToString().Replace("\"", "");

                                //var success = await App.SocialLogin(id, name, email);

                                //if (success)
                                //{
                                //    App.SuccessfulFacebookLoginAction();
                                //}
                            }
                            else
                            {
                               // App.CancelledFacebookLoginAction.Invoke();
                            }
                        };

                       // wasShown = true;
                        PresentViewController(Auth.GetUI(), true, null);
                    }
                }

It is showing me disallowed_UserAgent . How to solve this problem

Please help me!!

Thank you

Posts

  • AnubhavRanjanAnubhavRanjan INXamarin Team Xamurai

    @vsri1991 Are you facing a similar issue as mentioned in here. If so, can you provide more info.

  • vsri1991vsri1991 Member ✭✭
    edited November 2018

    @AnubhavRanjan Thank you for Reply.
    I am also working on sign in with Instagram using Xamarin.Auth.
    Instagram sign in working fine in Xamarin Android but in Xamarin iOS its showing "Auth Error".
    I don''t know why this coming.
    Please help me.
    Please find attached Zip File of Xamarin ios Project.

  • vsri1991vsri1991 Member ✭✭
    edited November 2018

    @AnubhavRanjan Thank you for Reply.
    I am also working on sign in with Instagram using Xamarin.Auth.
    Instagram sign in working fine in Xamarin Android but in Xamarin iOS its showing "Auth Error".
    I don''t know why this coming.
    Please help me.
    Please find attached Zip File of Xamarin ios Project.

  • vsri1991vsri1991 Member ✭✭

    @AnubhavRanjan : Any Updates?.

  • vsri1991vsri1991 Member ✭✭

    @AnubhavRanjan When can i expect the solution. Please let me know.

Sign In or Register to comment.