I've been some hours trying to do this, but i can't never get the data i'm trying to get. Do i need to do the request other way or something? there's my code:
doGoogleLogin(){
return new Promise<any>((resolve, reject) => {
let provider = new firebase.auth.GoogleAuthProvider();
provider.addScope('profile');
provider.addScope('email');
provider.addScope('https://www.googleapis.com/auth/user.birthday.read');
provider.addScope('https://www.googleapis.com/auth/user.gender.read');
this.afAuth.auth
.signInWithPopup(provider)
.then(res => {
resolve(res);
console.log(res.additionalUserInfo.profile['id']);
this.http
.get("https://people.googleapis.com/v1/people/"+res.additionalUserInfo.profile['id']+"?key=(a valid api key)&personFields=birthdays,genders")
.subscribe(data => (console.log(data)));;
}, err => reject(err))
})
}
What i usually get in data, from the http request is only:
{
"resourceName": "people/101296298961277932659",
"etag": "%EgQBBzcuGgQBAgUH"
}
And i should be getting 2 more objects containing the birthdate and gender, but it never happen.