Android Facebook SDK:如何检索好友图API响应
我从FacebookSDK中实现了这段代码以获得共同的朋友Android Facebook SDK:如何检索好友图API响应,android,facebook,facebook-graph-api,Android,Facebook,Facebook Graph Api,我从FacebookSDK中实现了这段代码以获得共同的朋友 Bundle params = new Bundle(); params.putString("fields", "context.fields(mutual_friends)"); // make the API call new Request( session, "/{user-id}", params
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();
如何读取响应对象并检索总计数和共同好友列表?我已成功地在日志中获得结果。
谢谢。展位人员需要自动调整您的朋友列表,才能看到共同的用户。若并没有,你们需要使用所有共同的朋友,但你们只需要在服务器上运行,而不需要在客户端工作。查看所有共同朋友的文档 我在这里解释这篇文章
对图形请求的响应是json编码的,因此您应该能够使用任何标准的json解析器?对不起,我是Android的初学者,对JSON一无所知。我已经尝试过:GraphObject go=response.getGraphObject;JSONObject jso=go.getInnerJSONObject;objectsummary=jso.getsummary;Log.d摘要,摘要;返回null。我很肯定我做错了,因为我是在猜测。如果你能帮助我,我将不胜感激。谢谢