请求 Facebook 个人资料图片和其他信息
Request Facebook profile picture with other information
我正在使用 js SDK,在用户使用 FB 登录后,我想请求电子邮件、名字、姓氏和图片(图片 link)。
这个有效:
FB.api('/me?fields=email,first_name,last_name',
(graph_response) ->
...
)
这也有效,但我得到的图片非常小(如果我在 /me/picture
请求 type=square
时得到的是同一张):
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)
更多信息:
我正在使用 js SDK,在用户使用 FB 登录后,我想请求电子邮件、名字、姓氏和图片(图片 link)。
这个有效:
FB.api('/me?fields=email,first_name,last_name',
(graph_response) ->
...
)
这也有效,但我得到的图片非常小(如果我在 /me/picture
请求 type=square
时得到的是同一张):
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)
更多信息: