How can I display the users profile pic using the facebook graph api?

前端 未结 9 639
被撕碎了的回忆
被撕碎了的回忆 2020-12-02 07:24

I would like to display the users profile picture inside of my applications canvas page, is there a way to do that using the graph api?

I know I can do it using FBML

9条回答
  •  我在风中等你
    2020-12-02 07:59

    EDIT: So facebook has changed it again! No more searching by username - have amended the answer below...

    https://graph.facebook.com/{{UID}}/picture?redirect=false&height=200&width=200
    
    • UID = the profile or page id
    • redirect either returns json (false) or redirects to the image (true)
    • height and width is the crop
    • does not require authentication

    e.g. https://graph.facebook.com/4/picture?redirect=false&height=200&width=200

    Facebook Graph picture doc

提交回复
热议问题