How can I get a high quality image using the React Native Facebook SDK GraphRequest?

I am trying to get a high resolution image using the React Native Facebook SDK, however the default image quality is very poor. It is 50x50 and very low resolution.

Inquiry:

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

answer

{
  "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"
}

Looking at the Facebook Graph API Docs API , there is a “type” parameter by which you can request a specific size (small, medium, large). However, it is unclear how to format this request.

picture?type=large // Error

picture{type:large} // 200 However, picture is omitted from Response
+4
source share
2 answers

API , :

picture.type(large)

+5

.height .width, , :

480x{any-width} : /me?fields=id,name,picture.height(480),[:other_fields]

{any-height}x480 : /me?fields=id,name,picture.width(480),[:other_fields]

: /me?fields=id,name,picture.height(10000),[:others_fields]

/{node-id}/picture https://developers.facebook.com/docs/graph-api/reference/user/picture/. API : https://developers.facebook.com/tools/explorer/

+3

Source: https://habr.com/ru/post/1670828/


All Articles