我一直在尝试从atmosphere.js 获取bengot:avatar 包以与Facebook 配合使用,但未能成功。当我使用 {{> avatar user=this shape="circle"}}
时,它似乎只显示一个灰色圆圈,里面没有图片。
其他调用,例如{{currentUser.profile.name}}
工作得很好。
无论是否有 bengott:avatar 包,如何成功显示头像?
最佳答案
使用此选项,您不需要访问 token 或任何特殊的东西来获取他们的个人资料图片,只需要他们的 Facebook 用户 ID。
Accounts.onCreateUser(function(options, user) {
if (options.profile) {
options.profile.picture = "http://graph.facebook.com/" + user.services.facebook.id + "/picture/?type=large";
user.profile = options.profile;
}
return user;
});
关于javascript - 在 Meteor 中显示 Facebook 头像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29148854/