FB Graph API: Mutual Friends returns empty array

a 夏天 提交于 2019-12-12 03:03:33

问题


I am having an FB app and I want to find mutual friends between 2 users using my app.

When I use Graph Explorer for my app to find the mutual friends between 2 users connected to my app, it returns the correct results.

However, when I run the same query on my facebook php sdk, I get empty results. This is my code:

$fb_app_id = $this->config->item('facebook_app_id');
$fb_secret = $this->config->item('facebook_secret');
$facebook = new Facebook(array(
                                    'appId'  => "$fb_app_id",
                                    'secret' => "$fb_secret",
                                    ));
$mutual_friends = $facebook->api("/802150300/mutualfriends/626070638");

$mutual_friends is an empty array here. Any ideas why I am getting it empty?


回答1:


I don't think the facebook API allows you to get mutuals friends between any two friends. You can only access how many mutual friends you and another friend have.



来源:https://stackoverflow.com/questions/15807266/fb-graph-api-mutual-friends-returns-empty-array

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!