我正在将facebook SDK集成到我的Android应用程序中。 我按照指南:https://developers.facebook.com/docs/graph-api/reference/v2.7/post。我尝试通过方法获取公共组中的帖子的详细信息:
final String POST_ID = "1446400445645839_1796360410649839";
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/" + POST_ID,
null,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
Log.d("DEBUG","post detail ---------------------");
Log.d("DEBUG",response.toString());
Log.d("DEBUG","post detail--------------------------");
}
}
).executeAsync();
我收到了回复:
{响应:responseCode:200,graphObject: {“created_time”:“2016-09-25T02:57:29 + 0000”,“消息”:“因为 它的_________卓越的客户服务,梅的美发沙龙是 该地区最受欢迎的商业活动。 \呐。审批\ NB。 估计\ NC。概率\ ND。声誉\nCâunàytrongETS2016.đáp á话案sìchìnhdownlàD。BạnnàogiảisthíchgiúpmìnghiữaCvàD đượckhôngạ?“,”id“:”1446400445645839_1796360410649839“},错误:null}
似乎错过了一些字段,如名称,标题,来自...... 你能解释并给我一些建议来获取名称,标题等字段吗?
更新: 我找到了这篇文章的解决方案:Android Facebook - How to get like count for a post?。
答案 0 :(得分:0)
https://developers.facebook.com/docs/graph-api/using-graph-api
默认情况下,并非您返回节点或边缘中的所有字段 进行查询。您可以选择所需的字段或边 返回字段查询参数。这非常有用 使您的API调用更加高效和快速。
例如,以下Graph API调用 https://graph.facebook.com/bgolub?fields=id,name,picture只会 返回Ben的个人资料中的id,姓名和图片: