流星,Facebook登录,返回不同的值:那么个人资料图片呢?
问题描述:
在流星的应用程序,当日志与本地主机上的Facebook,我获得了user.services.facebook
这些字段:流星,Facebook登录,返回不同的值:那么个人资料图片呢?
{
accessToken: 'long_acces_tkoen_string',
expiresAt: --,
id: '--',
email: '--',
name: '--',
first_name: '--',
last_name: '--',
link: 'https://www.facebook.com/--',
username: '--',
gender: '--',
locale: '--'
}
当我部署在https://modulus.io/我的应用程序,这些字段返回:
{
accessToken: '--',
expiresAt: --,
id: '--',
email: '--',
name: '--',
first_name: '--',
last_name: '--',
link: 'https://www.facebook.com/app_scoped_user_id/--/',
gender: '--',
locale: '--'
}
没有userneame,所以,我没有像以前那样构建的个人资料图片:'https://graph.facebook.com/' + user.services.facebook.username + '/picture?width=100&height=100'
我该如何重建它?
我明白,这可能是由这个原因引起:https://developers.facebook.com/docs/apps/changelog#v2_0_graph_api
但我不明白为什么(为什么它会在本地主机上运行,而不是在模数)
答
嗯,其实,你可以简单地使用id字段。我从未注意到这一点。
但用户有一个新的ID。例如,对于我而言,这些网址正在工作:
// old id field :
https://graph.facebook.com/558820281/picture?width=200&height=200
// old username field :
https://graph.facebook.com/huet.fabien/picture?width=200&height=200
// new id field
https://graph.facebook.com/10154176840535282/picture?width=200&height=200
'用户名'在API v2中不再可用。你是否使用相同的应用程序ID和相同的用户来测试它? – CBroe 2014-09-06 14:55:18
我用于本地开发的应用程序已经安装很久以前;和我用来刺激我的品牌。我认为老版本在AP v1上,而新版本在API v2上。但我怎么知道?我如何迁移?我不确定要理解这一点:https://developers.facebook.com/docs/apps/upgrading – fabien 2014-09-06 20:37:57