Facebook Graph API Change: Picture type (size) no longer working?

前端 未结 3 1802
梦如初夏
梦如初夏 2020-12-19 06:17

According to Facebook\'s Graph API documentation (here), you can access various sizes of a user\'s profile picture through URLs such as:

https://graph.facebo         


        
相关标签:
3条回答
  • 2020-12-19 06:45

    You must request the API with the field_expansion syntax

    These api requests works :

    $results = $facebook->api('/me', array('fields' => 'picture.height(300).width(300)'));

    $results = $facebook->api('/me', array('fields' => 'picture.type(large)'));

    0 讨论(0)
  • 2020-12-19 06:47

    As described in this bug on Facebook, you can request this via the new API "field expansion" syntax.

    This works for me:

    https://graph.facebook.com/____OBJECT_ID____?fields=picture.type(large)
    
    0 讨论(0)
  • 2020-12-19 06:56

    I found a workaround - profile pictures of various sizes can still be accessed via an FQL query:

    $pic = $facebook->api(array('method'=>'fql.query', 'query'=>"SELECT pic_big FROM user WHERE uid=$fb_uid"));
    

    ("pic_big" is equivalent to "type=large" - see here).

    This still doesn't explain why the GRAPH call suddenly broke though, or why image sizes don't seem to be accessible via Graph at all anymore (which I'd still like to know)...but at least there's some way to get the other size photos.

    Gotta love Facebook and their top-notch reliability...

    0 讨论(0)
提交回复
热议问题