繁体   English   中英

Android Facebook SDK:如何检索“共同的朋友” Graph API响应

[英]Android Facebook SDK: How to retrieve Mutual friends Graph API response

我从Facebook SDK实施了此代码以结识共同的朋友。

    Bundle params = new Bundle();
        params.putString("fields", "context.fields(mutual_friends)");
        // make the API call 
        new Request(
            session,
            "/{user-id}",
            params,
            HttpMethod.GET,
            new Request.Callback() {
                public void onCompleted(Response response) {
                    /* handle the result */
                    Log.d("results", response.toString());
                }
            }
        ).executeAsync(); 

如何阅读Response对象并检索总数和共同朋友列表? 我已经在日志中成功获取了结果。 谢谢。

展位人员需要对您的friend_list_permission进行授权,以使您看到相同的用户。 如果不是,您需要使用all_mutual朋友,但是您只能在服务器中运行它,而不能在客户端中运行。 在all_mutual_friends中查看文档。

我在这里解释这篇文章。

https://stackoverflow.com/a/34663235/3516549

暂无
暂无

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

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