public async void ProcessAuthenticationCompleted(GoogleOAuthToken token) { DismissViewController(true, null); var googleService = new GoogleService(); _googleUser = await googleService.GetUserProfileAsync(token.TokenType, token.AccessToken); await ViewModel.SaveUserGoogleiOS(_googleUser); }
public async Task <GoogleUserModeliOS> GetUserProfileAsync(string tokenType, string accessToken) { var httpClient = new HttpClient(); httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(tokenType, accessToken); string json = await httpClient.GetStringAsync($"https://www.googleapis.com/plus/v1/people/me?alt=json&access_token={accessToken}"); GoogleUserModeliOS user = JsonConvert.DeserializeObject <GoogleUserModeliOS>(json); return(user); }
public LoginViewController() : base(nameof(LoginViewController), null) { _googleUser = new GoogleUserModeliOS(); }