I know there will be a similar question in stackoverflow, but it does not seem to work in my case.
Here is my code:
public function fetchFriendDetails($accessToken, $userId) {
$curlUrl = 'https://graph.facebook.com/fql?access_token=' . $accessToken . '&pretty=0&q={' . urlencode('"v_1":"select uid,name,birthday_date,username,current_location from user where uid in (select uid1 from friend where uid2=me()) order by birthday_date desc"') . '}';
$ch = curl_init($curlUrl);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
$intermediate = Util::convertJsonString($output, 'uid', '\,', ',');
return Util::convertJsonString($intermediate, 'id', '\,', ',');
}
He gives me the following conclusion:
{"error":{"message":"(#12) fql is deprecated for versions v2.1 and higher","type":"OAuthException","code":12}}
I know that it is deprecated https://developers.facebook.com/docs/apps/changelog , but can anyone help me what should I change in my code above so that it returns the exact result?
Any help would be appreciated. thanks in advance
source
share