简体   繁体   English

Facebook all_mutual_friends无法正常工作

[英]Facebook all_mutual_friends not working

I'm building an iOS app that connects to Facebook's all_mutual_friends API 我正在构建一个连接到Facebook的all_mutual_friends API的iOS应用程序

https://developers.facebook.com/docs/graph-api/reference/user-context/all_mutual_friends/ https://developers.facebook.com/docs/graph-api/reference/user-context/all_mutual_friends/

The app has been reviewed and approved to connect to this API. 该应用已经过审核并获准用于连接此API。

When I make the graph call per the documentation: 当我根据文档调用图形时:

        let params = ["fields":"context.fields(all_mutual_friends.fields(picture.width(500).height(200)))"]
    FBSDKGraphRequest(graphPath: "/\(facebookID)", parameters: params, HTTPMethod: "GET").startWithCompletionHandler { (connection, result, error) in
        print("result: \(result)")
        print("error: \(error)")
    }

I get the following result: 我得到以下结果:

result: {
    context =     {
        id = dXNlcl9jb250ZAXh0OgGQ8qbGU5YUiZAKn8g4zuCb1LCMGj3PiCXfe7B72X5DoKkbMpHZA395xRT0iV8D84NQIZBCjJ3VRKC9uNUrMZCiwIeZBOSTRndZCQKi4pgiIgLoxI3xAZD;
    };
    id = 10208913134493418;
}

The above response is when we have a mutual friend who has the app installed. 以上回复是我们有一个安装了应用程序的共同朋友。

Does anyone know how to get the list of mutual friends? 有谁知道如何获得共同朋友的名单?


If I am Facebook friends with the person, I successfully receive a list of mutual friends making the same graph call. 如果我是这个人的Facebook好友,我会成功收到一个共同朋友的列表进行相同的图表调用。 This is the response: 这是回应:

  context =     {
    "all_mutual_friends" =         {
        data =             (
                            {
                "first_name" = Mary;
                picture =                     {
                    data =                         {
                        height = 200;
                        "is_silhouette" = 0;
                        url = "https://...";
                        width = 200;
                    };
                };
            }, //... 24 more results

This is great because there is data, but it is limited to 25 mutual friends. 这很好,因为有数据,但它仅限于25个共同的朋友。 Is there a way to increase the limit above 25? 有没有办法将限制提高到25以上?

According to the Facebook documentation you referred above : 根据您上面提到的Facebook文档:

The All Mutual Friends API must be called from your server to obtain the full list of mutual friends. 必须从您的服务器调用All Mutual Friends API才能获得共同朋友的完整列表。 Calling this API in JavaScript, Android, or iOS client code will omit some of the results. 在JavaScript,Android或iOS客户端代码中调用此API将省略一些结果。

This explains the limit you are facing. 这解释了您面临的限制。 :) :)

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

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