When I use the code below it gives me birthdays only for those who share his/her birthday with their friends. However, even if they don't share they had to give their birthdays to Facebook. Can I get all of the user's friends' birthdays? I already get user_birthday
and friends_birthday
permissions.
$friends=json_decode(file_get_contents('https://graph.facebook.com/me/friends?access_token=AAAEHQWIn3oMBADNX0oRCCUujv0Bx8GCKIWQkTIB6KfJxD001x'));
$friends = (array) $friends;
$friends = $friends['data'];
foreach($friends as $key => $friend)
{
$friend = (array) $friend;
$fql = "select name, birthday_date from user where uid=".$friend['id'];
$param = array(
'method' => 'fql.query',
'query' => $fql,
'callback' => ''
);
$fqlResult = $facebook->api($param);
print_r ($fqlResult);
}