Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting all friends' pictures using the fields parameter doesn't seem to work?

I use the JavaScript SDK for Facebook Connect. Yesterday I loaded all the friends of a logged in user like this:

https://graph.facebook.com/me/friends?fields=name,first_name,picture&access_token=MYACCESSTOKEN&callback=?

Using this code I got the id, name, first name and picture of all the friends that the logged in user has. This was called using AJAX/jsonp. As I said, it worked yesterday and no modifications have been done to the code since then.

Today I get the id, name and the first name - no picture(!) Could this be a glitch in Facebook Graph, has there been any updates that I could have missed or is the above call to the graph API invalid?

Is this a correct way to get the picture of all friends?

like image 788
tkahn Avatar asked Jan 19 '12 16:01

tkahn


1 Answers

You're right, the picture field is not being returned anymore. However it is very easy to get the picture URL. http://graph.facebook.com/{friendId}/picture you can either call that to get it programmatically, or even have that graph call as the src attribute of the image tag <img src="http://graph.facebook.com/{friendId}/picture" />.

like image 83
DMCS Avatar answered Nov 15 '22 05:11

DMCS