Hy,
I'm need to get a user's friends (Name, unique ID, profile pic). Graph api v2.0 does not allow that if I'm know it well. Is there any workaround, or solution, to get the necessary data?
I'm working with PHP SDK.
Thanks, Dave.
Hy,
I'm need to get a user's friends (Name, unique ID, profile pic). Graph api v2.0 does not allow that if I'm know it well. Is there any workaround, or solution, to get the necessary data?
I'm working with PHP SDK.
Thanks, Dave.
It's no longer possible to get all friends of a certain user with Graph API v2.0. Furthermore, all friend-related permissions have been removed.
Yes, you can get the list of your friends, but your friends first need to access your app, and grant permission first. You may ask permission with the following code ->
$params = array( 'scope' => 'public_profile, user_friends');
$login_url = $facebook->getLoginUrl($params);
echo 'Please <a href="' . $login_url . '">login.</a>';
And then this to print your list ->
$fr = $facebook->api('/me/friends','GET');
foreach ($fr['data'] as $value) {
echo "<pre>";
echo "Friend Name: ";
print_r($value['name']);
echo "<br />";
}
Please note, this is when you use the SDK v3