0

I was successful in retrieving user's basic profile, but I want to fetch birthday as well. How can I make this to work? Check my codes:

<script src="https://apis.google.com/js/platform.js" async defer></script>
<meta name="google-signin-client_id" content="XXXXXXXXXXXXXX">

<script>
function onSignIn(googleUser) {
var profile = googleUser.getBasicProfile();
console.log('ID: ' + profile.getId()); 
console.log('Name: ' + profile.getName());
console.log('Image URL: ' + profile.getImageUrl());
console.log('Email: ' + profile.getEmail());

});                                                          

}
</script>


<div class="g-signin2" data-onsuccess="onSignIn"></div>
Clyde Winux
  • 285
  • 1
  • 3
  • 12

1 Answers1

0

BasicProfile doesn't contain birthday. You have to manually retrieve profile information using Google+ API. Here is working code that does that: https://stackoverflow.com/a/29903252/1256609

Community
  • 1
  • 1
Jarosław Gomułka
  • 4,935
  • 18
  • 24