FB Graph API:Mutual Friends返回空数组 [英] FB Graph API: Mutual Friends returns empty array

查看:108
本文介绍了FB Graph API:Mutual Friends返回空数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个FB应用程序,我想使用我的应用程序在两个用户之间找到共同的朋友。

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

当我使用图形浏览器为我的应用程序找到相互2个用户连接到我的应用程序的朋友,它返回正确的结果。

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.

但是,当我在我的Facebook php sdk上运行相同的查询时,我会得到空的结果。这是我的代码:

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是一个空数组。任何想法为什么我会得到它空白?

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

推荐答案

我不认为Facebook API允许你在任何两个朋友。你只能访问你和另一个朋友有多少共同的朋友。

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.

这篇关于FB Graph API:Mutual Friends返回空数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆