【问题标题】:Google+ API Javascript get BirthdayGoogle+ API Javascript 获得生日
【发布时间】:2015-07-05 04:55:31
【问题描述】:

我成功检索了用户的基本资料,但我也想获取生日。我怎样才能使它起作用?检查我的代码:

<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>

【问题讨论】:

    标签: javascript google-api google-plus google-api-js-client


    【解决方案1】:

    BasicProfile 不包含生日。你必须manually retrieve profile information using Google+ API。这是执行此操作的工作代码:https://stackoverflow.com/a/29903252/1256609

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-03-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-09-03
      • 1970-01-01
      • 2022-01-18
      相关资源
      最近更新 更多