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

前端 未结 9 609
被撕碎了的回忆
被撕碎了的回忆 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:56

    Here is the code that worked for me!

    Assuming that you have a valid session going,

    //Get the current users id
    $uid = $facebook->getUser();
    
    //create the url
    $profile_pic =  "http://graph.facebook.com/".$uid."/picture";
    
    //echo the image out
    echo "";
    

    Thanx goes to Raine, you da man!

提交回复
热议问题