How to use FB.api('/me/picture') to get profile image

后端 未结 5 1222
你的背包
你的背包 2020-12-29 14:43

This is a very silly question. I\'m a beginner with facebook Javascript SDK. So I\'m trying to make a the user\'s profile image to show I used this code

FB.         


        
5条回答
  •  悲&欢浪女
    2020-12-29 15:04

    You can get specific sizes of the profile pic as well:

    FB.api("/me/picture?width=180&height=180",  function(response) {
    
            console.log(response.data.url);
    
    });  
    

    See the Facebook documentation to see what different picture sizes you can get.

    And a complete demo with login at: Get Facebook Profile Picture with Javascript SDK

提交回复
热议问题