I try to build my first Facebook application and I have some issues. I want to get some info about the friends of the logged-in user. To do this I use:
$friends =
$facebook->api(“/me/friends?fields=id,name,birthday,location,hometown”);
and some more info, like gender, likes etc.
The issue is that this query doesn’t work, no matter what fields I send, I get only name and id.
On login I have something like this:
$loginUrl = $facebook->getLoginUrl(array(
'req_perms' => 'user_birthday,friends_birthday,user_relationships,friends_relationships'
));
so I think that is not an issue of permissions.
How do I get all the friend(s) info I need? Where I’m wrong in the code I use?
Thank you.
It should look like this:
Make sure you have an up-to-date SDK and go here Facebook PHP SDK