我正在使用js SDK,并且在用户使用FB登录后,我想请求电子邮件,名字,姓氏和图片(指向图片的链接)。
这有效:
FB.api('/me?fields=email,first_name,last_name',
(graph_response) ->
...
)
这也可以,但是我得到的图片非常小(如果我在
type=square
上请求/me/picture
,则是同一张图片):FB.api('/me?fields=email,first_name,last_name,picture',
(graph_response) ->
...
)
我知道我可以通过此调用获得更大的个人资料图片(足够大):
FB.api('/me/picture?type=large&redirect=false',
(graph_response) ->
...
)
有什么办法可以在一个请求中将两者结合?我没有运气尝试过
/me?fields=email,first_name,last_name,picture&type=large
。 最佳答案
这有效:
/me?fields=email,first_name,last_name,picture.type(large)
或者,您可以指定大小:
/me?fields=email,first_name,last_name,picture.width(100).height(100)
更多信息:https://stackoverflow.com/a/27006154/757508
关于javascript - 索取Facebook个人资料图片以及其他信息,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/54949296/