Warm tip: This article is reproduced from serverfault.com, please click

javascript-如何使用React Native Facebook SDK GraphRequest获得高质量的个人资料图片?

(javascript - How can I get a high quality profile picture using React Native Facebook SDK GraphRequest?)

发布于 2017-02-25 15:17:30

我正在尝试使用React Native Facebook SDK获得高分辨率图片,但是默认图像质量非常差。它是50x50,分辨率很低。

要求:

new GraphRequest('/135121013672357',
  {
    parameters: {
      fields: {
        string: 'picture'
      }
    }
  },
  _responseInfoCallback
)

回复

{
  "picture": {
    "data": {
      "is_silhouette": false,
      "url": "https://scontent.xx.fbcdn.net/v/t1.0-1/p50x50/16864988_145199975997794_4154735936748679550_n.jpg?oh=bb5f32ecb73dd9b8fb8ac45920e2ffc5&oe=593223A8"
    }
  },
  "id": "135121013672357"
}

查看Facebook的Graph API文档,有一个参数“ type”,通过该参数可以请求特定大小(小,中,大)。但是,尚不清楚如何格式化该请求。

picture?type=large // Error

picture{type:large} // 200 However, picture is omitted from Response
Questioner
AndrewHenderson
Viewed
0
max23_ 2017-02-26 14:23:21

尝试使用Graph API字段扩展来获取资源:

picture.type(large)