I think it must be simple but couldnt find an example.
I'm using the basic google signin example. with header tags (including birthday scope):
<meta name="google-signin-scope" content="profile email https://www.googleapis.com/auth/user.birthday.read" />
<meta name="google-signin-client_id" content="xxx my id xxx" />
<script src="https://apis.google.com/js/platform.js" async defer></script>
and a defualt login button in the html body:
<div id="gsignin" class="g-signin2" data-onsuccess="onSignIn" data-theme="dark"></div>
and js:
function onSignIn(googleUser) {
var profile = googleUser.getBasicProfile();
console.log(googleUser);
console.log("ID: " + profile.getId());
console.log("Name: " + profile.getName());
console.log("Image URL: " + profile.getImageUrl());
console.log("Email: " + profile.getEmail());
g_token = googleUser.getAuthResponse().id_token;
}
All this works just fine, user is asked to grant permissions. and i get the general profile info. but i'm not sure how to obtain the birthday date, is it somehow in the returned object? do i need another call to the api?
I've seen lots of examples about using scopes but couldn't find how to actually read the data(birthday date)... same thing for gender, don't think there is a special scope for that, i guess it should be part of the basic profile info(?)
Thanks in advance
edit: just to clarify, i know i'm using the right scope. i don't know how to read the data. for example, after user authenticated - profile.getEmail() will return the email. what would return the birthday?