I am trying to build an Ionic 2 App with google sign in and I need to retrieve the persons gender and birthday.
This is my code so far:
doGoogleLogin() {
GooglePlus.login(
{
'scopes': 'profile',
'webClientId': 'myClientId'
}
)
.then(userData => {
let token = userData.idToken;
console.log(JSON.stringify(userData);
})
.catch(err => console.error(err));
}
The userData only contains an idToken, email and name of the user.
Ionics Google Plus Plugin does not provide a function for calling any other API endpoint. I already tried to get an oauth access token from https://accounts.google.com/o/oauth2/v2/auth and use the Google People API with https calls but I could not make it work.
Any help will be appreciated!
These sources may also be helpful: Google People API, OAuth 2.0 for Mobile Apps