예제 #1
0
        public async void OnAuthenticationCompleted(FacebookOAuthToken token)
        {
            DismissViewController(true, null);

            var facebookService = new FacebookService();
            var email           = await facebookService.GetEmailAsync(token.AccessToken);

            FacebookLoginButton.SetTitle($"Connected with {email}", UIControlState.Normal);
        }
예제 #2
0
        public async void OnAuthenticationCompleted(FacebookOAuthToken token)
        {
            // Retrieve the user's email address
            var facebookService = new FacebookService();
            var email           = await facebookService.GetEmailAsync(token.AccessToken);

            // Display it on the UI
            var facebookButton = FindViewById <Button>(Resource.Id.facebookLoginButton);

            facebookButton.Text = $"Connected with {email}";
        }
 private void OnAuthenticationCompleted(object sender, AuthenticatorCompletedEventArgs e)
 {
     if (e.IsAuthenticated)
     {
         var token = new FacebookOAuthToken
         {
             AccessToken = e.Account.Properties["access_token"]
         };
         _authenticationDelegate.OnAuthenticationCompletedAsync(token);
     }
     else
     {
         _authenticationDelegate.OnAuthenticationCanceled();
     }
 }
예제 #4
0
        private void ProcessAuthenticationCompleted(object sender, AuthenticatorCompletedEventArgs eventArgument)
        {
            if (!eventArgument.IsAuthenticated)
            {
                _authenticationDelegate.ProcessAuthenticationCanceled();
                return;
            }

            var token = new FacebookOAuthToken
            {
                AccessToken = eventArgument.Account.Properties[Constants.AccessToken]
            };

            _authenticationDelegate.ProcessAuthenticationCompleted(token);
        }
예제 #5
0
        public void OnAuthenticationCompleted(FacebookOAuthToken token)
        {
            var facebookService = new FacebookService();
            var email           = facebookService.GetEmailAsync(token.AccessToken);

            if (!string.IsNullOrWhiteSpace(email))
            {
                new AlertDialog.Builder(this)
                .SetTitle("Success!!!")
                .SetMessage($"It work's. Email: { email }")
                .Show();
            }
            else
            {
                new AlertDialog.Builder(this)
                .SetTitle("Authentication completed")
                .SetMessage("Email is still empty")
                .Show();
            }
        }
 public void OnAuthenticationCompleted(FacebookOAuthToken token)
 {
     var _token = token;
 }