title: Facebook OAuth Xamarin Forms Redirection
body: <p><a href="https://i.stack.imgur.com/Z3Rar.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Z3Rar.png" alt="enter image description here"></a></p>
  
  <p>I am using xamarin forms OAuth2 to signin into Facebook, Google and Twitter.</p>
  
  <p>On android it works. But on iOS it screen freezes with spinning activity indicator at top right corner. Is there any one having same issue ?.</p>
  
  <p>Update: Please find below code</p>
  
  <pre class="lang-cs prettyprint-override"><code>partial void UIButton15_TouchUpInside(UIButton sender)
  {
      // https://developers.facebook.com/apps/
      var auth = new OAuth2Authenticator(
      clientId: "ID",
      scope: "",
      authorizeUrl: new Uri("https://m.facebook.com/dialog/oauth/"),
      redirectUrl: new Uri("http://www.facebook.com/connect/login_success.html"));
  
      var ui = auth.GetUI();
  
      auth.Completed += FacebookAuth_Completed;
  
      PresentViewController(ui, true, null);
  }
  
  async void FacebookAuth_Completed(object sender, AuthenticatorCompletedEventArgs e)
  {
      if (e.IsAuthenticated)
      {
          var request = new OAuth2Request(
              "GET",
              new Uri("https://graph.facebook.com/me?fields=name,picture,cover,birthday"),
              null,
              e.Account);
  
          var fbResponse = await request.GetResponseAsync();
          var fbUser = JsonValue.Parse(fbResponse.GetResponseText());
          var name = fbUser["name"];
          var id = fbUser["id"];
          var picture = fbUser["picture"]["data"]["url"];
          var cover = fbUser["cover"]["source"];
      }
      DismissViewController(true, null);
  }
  </code></pre>
  
  <p>On facebook developer site:</p>
  
  <p>Created app using Facebook login plugin.
  Added redirect URL as <a href="http://www.facebook.com/connect/login_success.html" rel="noreferrer">http://www.facebook.com/connect/login_success.html</a></p>