本文介绍了Android Facebook - 如何获得一个帖子的数量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找这个约2周,但找不到任何东西。关于这一点的每一个回应都是指旧版的Facebook API。我可以得到一个Facebook页面的饲料,但我也想得到这些帖子的评论和评论。我正在玩图形浏览器,但找不到任何解决方案。



如果有人知道并与我分享,我真的很感激。



提前谢谢! >

这里我的GET请求:

  GraphRequest g = new GraphRequest(
AccessToken.getCurrentAccessToken(),
url,
null,
HttpMethod.GET,
new GraphRequest.Callback(){
public void onCompleted(GraphResponse response){

//我的代码

}
}
);

Bundle parameters = new Bundle();
parameters.putString(fields,full_picture,message,type,source,created_time,id);
parameters.putString(limit,50);
g.setParameters(parameters);
g.executeAsync();


解决方案

你应该看看文档: / p>






示例调用将是

  GET /BuzzFeed/posts?limit=1&fields=id,message,full_picture,type,source,created_time,comments.summary(true).limit(0),likes.summary(true).limit(0)

从页面中获取最新的 BuzzFeed 获取您想要的详细信息:

  {
data:[
{
id:21898300328_10153915728380329,
message:

I am searching for this for about 2 weeks but cannot find anything. Every response about that refers to an older version of Facebook API. I can get feed of a facebook page, but I want to get like and comment counts for those posts too. I am playing with Graph Explorer but can not find any solution.

I really appreciate if anyone knows it and shares with me.

Thank you in advance!

Here my GET request:

      GraphRequest g = new GraphRequest(
            AccessToken.getCurrentAccessToken(),
            url,
            null,
            HttpMethod.GET,
            new GraphRequest.Callback() {
                public void onCompleted(GraphResponse response) {

                   // my code

                }
            }
      );

      Bundle parameters = new Bundle();
      parameters.putString("fields", "full_picture,message,type,source,created_time,id");
      parameters.putString("limit","50");
      g.setParameters(parameters);
      g.executeAsync();
解决方案

You should have had a look on the docs:

A sample call would be

GET /BuzzFeed/posts?limit=1&fields=id,message,full_picture,type,source,created_time,comments.summary(true).limit(0),likes.summary(true).limit(0)

which fetches the most recent BuzzFeed post from the page and gets the details you want:

{  "data": [    {      "id": "21898300328_10153915728380329",      "message": "                        

这篇关于Android Facebook - 如何获得一个帖子的数量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-21 03:05