使用聚合物firebase-element

时间:2016-04-29 16:23:21

标签: polymer-1.0

我在这里使用聚合物提供的示例:In the polymer documentation 或直接来自此示例x-login

但我现在需要的是在Facebook中接收用户的邮件,例如,在这部分的代码中:

 <h3>User ID:</h3>
<pre>{{user.uid}}</pre>

他们使用user.uid从facebook获取ID,但我也想要邮件和名称,但我不能得到那些:(,你知道怎么做吗?

非常感谢

1 个答案:

答案 0 :(得分:0)

我想你没有在authWithOAuthPopup方法的可选第三个参数中使用“scope”。

ref.authWithOAuthPopup("facebook", function(error, authData) {
  if(error) {
    console.log("Esto es un Error", error.message);
  } else {
    console.log("Ok", authData);
  }
},{
  scope: 'email'
});

在Facebook开发人员文档中,您将找到可以要求的不同权限。其中一些您需要在应用程序facebook仪表板中验证您的应用程序。 https://developers.facebook.com/docs/facebook-login/permissions