How To Get BirthDate or Gender In Google Plus Login Ionic3?

831 Views Asked by At

How To Get BirthDate or Gender In Google Plus Login Ionic3 ?

 GPLogin(){  
      this.googlePlus.login({'scopes': 'https://www.googleapis.com/auth/plus.login'})
      .then(res => {
      console.log(res);
      alert("success "+JSON.stringify(res));
      })
      .catch(err => {
      console.error(err);
      alert("error "+JSON.stringify(err));
      });
    }
1

There are 1 best solutions below

0
Unkn0wn0x On BEST ANSWER

You should take a look at the google plus cordova plugin documentation.

If You search for scope, You will find what You are looking for. You need to add Your required scopes to be able to get the users profile data.

A complete list of all google scopes can be found here

In Your case it should be the Google People API, v1.

https://www.googleapis.com/auth/user.birthday.read = View your complete date of birth.

But beware of the known bugs related to the scope feature.