Polymer 谷歌签名堂';不返回用户信息

Polymer 谷歌签名堂';不返回用户信息,polymer,web-component,google-signin,google-web-component,Polymer,Web Component,Google Signin,Google Web Component,我正在使用GoogleWebComponents中的元素,但我不知道如何返回用户信息 <google-signin client-id="{{my-id}}" scopes="email profile" signed-in="{{signedIn}}"></google-signin> 请原谅,如果这是愚蠢的问题,但我不擅长网络开发。 感谢您的建议。聚合物文档: 当用户成功登录时,谷歌登录成功事件被触发 验证并谷歌登录失败,否则会触发 这个案子

我正在使用GoogleWebComponents中的元素,但我不知道如何返回用户信息

<google-signin
      client-id="{{my-id}}" scopes="email profile"
      signed-in="{{signedIn}}"></google-signin>
请原谅,如果这是愚蠢的问题,但我不擅长网络开发。
感谢您的建议。

聚合物文档:

当用户成功登录时,谷歌登录成功事件被触发 验证并谷歌登录失败,否则会触发 这个案子。这两个事件还将提供 谷歌客户端认证过程。您也可以使用isAuthorized 属性以观察身份验证状态

其他事件,如谷歌注销尝试谷歌注销在用户尝试注销并退出时触发 成功注销

当通过请求作用域时,google signin Essential事件被触发 google登录感知元素需要额外的用户权限


在这里您可以找到完整的演示:

谢谢您的讲解。当我在浏览器中运行google signin aware时,我成功地让它工作和运行,但当我在我的设备上运行它时,我在handleSignIn中得到以下信息:“Uncaught TypeError:无法读取null的属性'currentUser'。当我通过Android Studio运行它时,或者当我将客户端id更改为Android id后生成签名的apk时,就会发生这种情况。感谢您的帮助。
function (signedIn) {
       var profile = gapi.auth2.getAuthInstance().currentUser.get().getBasicProfile();
       console.log('Name: ' + profile.getName());
       console.log('Image: ' + profile.getImageUrl());
  }
<google-signin ... id="myLoginIn"></google-signin>
<script>
  var t = document.querySelector('#t');

  t.addEventListener('google-signin-success', function(data) {
    ...
  });
</script>
<google-signin client-id="{{my-id}}" scopes="email profile" signed-in="{{signedIn}}"></google-signin>

<google-signin-aware
        scopes="{{scope}}"
        signed-in="{{signedIn}}"
        is-authorized="{{isAuthorized}}"
        need-additional-auth="{{needAdditionalAuth}}"
        on-google-signin-aware-success="handleSignIn"
        on-google-signin-aware-signed-out="handleSignOut"></google-signin-aware>
var aware = document.querySelector('#awareness');
aware.handleSignIn = function(response) {
      console.log('[Aware] Signin Response', response);
      var userName = gapi.auth2.getAuthInstance().currentUser.get().getBasicProfile().getName();
};