简体   繁体   English

朋友的朋友/ 2度朋友的列表。 Facebook Graph API

[英]Friends of Friends/2nd degree friend's list. Facebook Graph API

I am trying to get a list of my friend's friends using the iPhone Facebook SDK. 我正在尝试使用iPhone Facebook SDK来获得我朋友的朋友的列表。 I've tried an approach using FQL and the Graph API but I get an error in both cases: 我已经尝试过使用FQL和Graph API的方法,但是在两种情况下都出现错误:

"Can't lookup all friends of YYYYYY. Can only lookup for the logged in user (XXXXX), or friends of the logged in user with the appropriate permission" “无法查找YYYYYY的所有朋友。只能查找已登录用户(XXXXX)或具有适当权限的已登录用户的朋友”

I've done some research and see that this functionality wasn't available through the Facebook API up until October 2010. But then radio silence. 我已经进行了一些研究,发现直到2010年10月,该功能才可以通过Facebook API使用。 Well, it's almost 6 months later. 好吧,差不多六个月后。 So was this ever implemented? 那么这曾经实施过吗?

I have requested all permissions I need for my app as well. 我还请求了我的应用所需的所有权限。

This functionality does not exist in the Facebook Social Graph API or the FQL API. Facebook Social Graph API或FQL API中不存在此功能。

During my quest to find out how to accomplish this I found many developers who asked the same question. 在探索如何实现这一目标的过程中,我发现许多开发人员提出了相同的问题。 Some developers have been asking for this feature for over 2 years. 一些开发人员一直要求此功能超过2年。 I think the FB team may consider it a privacy of performance concern. 我认为FB团队可能会认为这是性能隐患。

I have worked on it. 我已经做了。 I was able to see friends of my friend. 我能够见到我朋友的朋友。

It needs following requirements: 它需要满足以下要求:

  1. Your friend needs to be using application. 您的朋友需要使用应用程序。
  2. Permission from application read_stream, publish_stream, publish_checkins. 来自应用程序read_stream,publish_stream,publish_checkins的权限。

Try this fql query. 试试这个fql查询。

$query="SELECT uid, name, work_history FROM user 
      WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 IN 
      ( SELECT uid FROM user WHERE uid IN 
         (SELECT uid2 FROM friend WHERE uid1 = $fb_id ) and is_app_user=1)
       )";

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM