【问题标题】:Request Facebook profile picture with other information请求带有其他信息的 Facebook 个人资料图片
【发布时间】:2019-03-01 17:07:39
【问题描述】:

我正在使用 js SDK,在用户使用 FB 登录后,我想请求电子邮件、名字、姓氏和图片(图片链接)。

这行得通:

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,但没有成功。

【问题讨论】:

    标签: javascript facebook facebook-javascript-sdk


    【解决方案1】:

    这行得通:

    /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

    【讨论】:

      猜你喜欢
      • 2012-01-09
      • 1970-01-01
      • 2013-11-24
      • 1970-01-01
      • 2012-06-08
      • 1970-01-01
      • 2017-09-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多