title: Xamarin IOS facebook auth
body: <p>I am new in xamarin mobile development. And I have a question about facebook auth in Xamarin ios project.</p>
  
  <p>I have webapi at backend and it has methods for external login(ExternalLogin,RegisterExternal etc). As I understood I shouldn't use my webapi and I should use component from <a href="https://components.xamarin.com/view/facebookios" rel="nofollow">https://components.xamarin.com/view/facebookios</a>.</p>
  
  <p>It works fine and as I understood it works in webview. The question is that before register that external user I need more info about user get user phone which user should type by his self. </p>
  
  <p>I use Navigation controller in mainstoryboard at first view controller I have button "Facebook auth", after clicking user go to FacebookAuthViewController where I have 3 x Text Field(Surname, Name, Phone number). I want next magic when user go to this viewcontroller user will see facebook auth page and after getting access token he will see that 3 text fields(Surname, Name, Phone number), I will fill surname and name by info from his facebook account and phone number user should type by his self. When I add 3 input on view controller and didn't bind Name to text fields it works(Firstly user see webview with facebook auth after success auth he sees three input textboxes), but when I type name for any input field webview didn't appear and after clicking in main window on Facebook Auth button I only see 3 text fields. What I did wrong?
  In default constructor I do next:</p>
  
  <pre><code>        _fb = new FacebookClient();
          nsUrl = new NSUrl(GetFacebookLoginUrl(AppId, ExtendedPermissions));
  
          // We delete cache and cookies so it does not remember our login information
          DeleteCacheandCookies();
  
          web = new UIWebView(UIScreen.MainScreen.ApplicationFrame)
          {
              BackgroundColor = UIColor.White,
              AutoresizingMask = UIViewAutoresizing.All,
          };
  
          web.LoadStarted += (webview, e) =&gt;
          {
              NetworkActivity = true;
              //FacebookLoader.Hidden = true;
          };
  
          web.LoadFinished += (webview, e) =&gt;
          {
              NetworkActivity = false;
              //FacebookLoader.Hidden = false;
              var wb = webview as UIWebView;
              FacebookOAuthResult oauthResult;
              if (!_fb.TryParseOAuthCallbackUrl(new Uri(wb.Request.Url.ToString()), out oauthResult))
              {
                  return;
              }
  
              if (oauthResult.IsSuccess)
              {
                  web.Hidden = true;
                  // Facebook Granted Token
                  var accessToken = oauthResult.AccessToken;
                  //NavigationController.PushViewController(new FacebookRegisterViewController(), true);
                  LoginSucceded(accessToken);
              }
              else
              {
                  // user cancelled login
                  LoginSucceded(string.Empty);
              }
          };
  
          web.LoadError += (webview, args) =&gt;
          {
              NetworkActivity = false;
              //FacebookLoader.Hidden = false;
              if (web != null)
                  web.LoadHtmlString(
                      String.Format("&lt;html&gt;&lt;center&gt;&lt;font size=+5 color='red'&gt;{0}:&lt;br&gt;{1}&lt;/font&gt;&lt;/center&gt;&lt;/html&gt;",
                                 "An error occurred: ", args.Error.LocalizedDescription), null);
          };
  
          View.AddSubview(web);
          web.LoadRequest(NSUrlRequest.FromUrl(nsUrl));
  </code></pre>