private async void OnTwitterAuthenticationCompletedAsync(object sender, AuthenticatorCompletedEventArgs e) { var authenticator = sender as OAuth1Authenticator; if (authenticator != null) { authenticator.Completed -= OnTwitterAuthenticationCompletedAsync; authenticator.Error -= OnTwitterAuthenticationFailed; } if (e.IsAuthenticated) { //now user is authenticated,so lets go and save important keys AccountStore.Create().Save(e.Account, Constants.TwitterAppNameAndorid); var request = new OAuth1Request("GET", new Uri("https://api.twitter.com/1.1/account/verify_credentials.json"), null, e.Account); var response = await request.GetResponseAsync(); if (response != null) { string userJson = response.GetResponseText(); Debug.Print(userJson); Models.TwitterUser twitterUser = JsonConvert.DeserializeObject <Models.TwitterUser>(userJson); //lets update ui with data received from provider UpdateProfileUIWith(twitterUser); } //var request = new OAuth2Request("GET", new Uri(Constants.UserInfoUrl), null, e.Account); //var response = await request.GetResponseAsync(); //if (response != null) //{ //string userJson = response.GetResponseText(); //user = JsonConvert.DeserializeObject<GoogleUserModel>(userJson); ////lets update ui with data received from provider //UpdateProfileUIWith(user); //} } }
public static string ToJson(this TwitterUser self) => JsonConvert.SerializeObject(self, GoogleNonNativeLogin.Models.Converter.Settings);