Ejemplo n.º 1
0
        public async void OnAuthenticationCompleted(TwitterOAuthToken token)
        {
            DismissViewController(true, null);

            var twitterService = new TwitterService(Configuration.ClientId, Configuration.ClientSecret);
            var email          = await twitterService.GetEmailAsync(token);

            LoginButton.SetTitle($"Connected with {email}", UIControlState.Normal);
        }
        public async void OnAuthenticationCompleted(TwitterOAuthToken token)
        {
            // Retrieve the user's email address
            var twitterService = new TwitterService(Configuration.ClientId, Configuration.ClientSecret);
            var email          = await twitterService.GetEmailAsync(token);

            // Display it on the UI
            LoginButton.Text = $"Connected with {email}";

            _auth = null;
        }
Ejemplo n.º 3
0
        public async Task <string> GetEmailAsync(TwitterOAuthToken token)
        {
            const string url = "https://api.twitter.com/1.1/account/verify_credentials.json";

            var parameters = new SortedDictionary <string, string>
            {
                { "include_email", "true" }
            };

            var result = await TwitterHelper.GetAsync <TwitterEmail>(OauthConsumerKey, OauthConsumerSecret, token.Token, token.TokenSecret, url, parameters);

            return(result.Email);
        }