Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
 public LoginViewController() : base(nameof(LoginViewController), null)
 {
     _googleUser = new GoogleUserModeliOS();
 }