无法获取" COUNT"在"喜欢"和"意见"用我自己的注册应用程序的access_token领域 [英] Can't get "count" in "likes" and "comments" fields using my own registered app's access_token

查看:152
本文介绍了无法获取" COUNT"在"喜欢"和"意见"用我自己的注册应用程序的access_token领域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

主要问题:

当我发出GET请求来检索someID /职位的数据,如 <$c$c>https://graph.facebook.com/microsoft/posts?fields=comments,likes&limit=1&access_token=,不能得到的计数在喜欢和评论用我自己的Facebook注册应用程序生成的访问令牌领域,但如果使用来自Facebook的样例应用程序的访问令牌可以得到预期的数据,例如 HelloFacebookSample

When I sent a GET request to retrieve data of someID/POSTS, like https://graph.facebook.com/microsoft/posts?fields=comments,likes&limit=1&access_token=, cannot get the "count" in "likes" and "comments" fields using the access token generated by my own facebook registered app, but can get the expected data if using the access token from Facebook Sample apps, e.g. "HelloFacebookSample".

此问题发生在Android和FB图形API Exploer。此外,在奥得河,以解决可能的原因,我用完全相同的codeS为FB样品在我注册APP_ID,但同样的问题又出来了。因此,唯一可能的解释我能想到的是一些奇怪的事情FB APP_ID,而不是许可范围或不同的用户(我用两个用户测试)。

This issue occurs on both Android and FB Graph API Exploer. Also in oder to troubleshoot the possible causes, I used the exactly same codes as FB sample under my registered app_id, but the same problem came out again. So the only possible explanation I can think of is some strange things with FB app_id, not the permission scopes or different users(I've tested using two users).

下面就是从GET请求反应变量 <$c$c>https://graph.facebook.com/microsoft/posts?fields=likes&limit=1&access_token=:

Here is, the Reponses from GET request of https://graph.facebook.com/microsoft/posts?fields=likes&limit=1&access_token=:

1.使用access_token所产生的我APP_ID

1.Using access_token generated by my app_id:

{
  "data": [
    {
       "id": "20528438720_10151574758413721", 
       "created_time": "2013-07-18T18:41:51+0000", 
       "likes": {
          "data": [
            {
               "id": "701134683", 
               "name": "Someone's name"
            }, 
            {
               "id": "113770258795376", 
               "name": "Someone's name"
            }
            /****and so on****/
        ], 
        "paging": {
         "cursors": {
           "after": "MTAwMDAwNjkxNDMxMTcz", 
           "before": "NzAxMTM0Njgz"
         }, 
         "next": "https://graph.facebook.com/20528438720_10151574758413721/likes?limit=25&after=MTAwMDAwNjkxNDMxMTcz"
       }
     }
   }
  ], 
  "paging": {
    "previous": "https://graph.facebook.com/20528438720/posts?fields=likes&limit=1&since=1374172911", 
    "next": "https://graph.facebook.com/20528438720/posts?fields=likes&limit=1&until=1374172910"
  }
}

2,使用access_token按 FB的样品产生APP_ID (这里可以算喜欢的):

2.Using access_token generated by FB's sample app_id(here it can get "count" of likes):

{
  "data": [
      {
        "likes": {
          "data": [
          {
                "name": "Someone's name", 
              "id": "100003531173993"
            }, 
            {
              "name": "Someone's name", 
              "id": "100002299390558"
            }, 
            {
              "name": "Someone's name", 
              "id": "1038509978"
            }, 
            {
              "name": "Someone's name", 
              "id": "1615491698"
            }
          ], 
        "count": 1071
      }, 
      "id": "20528438720_10151574758413721", 
      "created_time": "2013-07-18T18:41:51+0000"
    }
  ], 
  "paging": {
    "previous": "https://graph.facebook.com/20528438720/posts?fields=likes&limit=1&since=1374172911", 
    "next": "https://graph.facebook.com/20528438720/posts?fields=likes&limit=1&until=1374172910"
  }
}

这真的很困惑我好几天了,我已经做了很多的搜索,却找不到这可能是因为我的英文任何有用的或相关的信息:P。没有任何人面对类似的问题?

It really confused me for days, and I've done lots of searches, but cannot find any useful or related info perhaps due to my English:P. Did anyone else face the similar problems?

感谢您的阅读。

任何帮助或替代解决方案AP preciated! (在这里,我只是想显示在我的应用程序喜欢的号码)

Any help or alternative solution appreciated! (here, I just want to display the number of likes in my app)

推荐答案

刚刚找到了解决办法我自己,这是所有由于FB的移民的在2013年10月重大更改。他们改变的post_id /喜欢的格式,但很可能在迁移已尚未完成,所以有一些不同之处。以下是我从Facebook的开发警报得到了官方声明。

Just found the solution myself, it is all due to the FB's migration for the October 2013 Breaking Changes. They change the POST_ID/likes format, but probably as the migration has not been completed yet, so there are some inconsistencies. The following is an official statement that I got from the Facebook Developer Alert.

的post_id /喜欢格式将改变。应用程序将能够为获取所有上后(而不是第4因为它是今天)通过分页喜欢。由于功能更新的结果,等数将会移动到汇总字段

POST_ID/likes format will change. Apps will be able to retrieve all likes on a post (rather than the first 4 as it is today) through paging. As a result of the functionality update, the like count will be moved to the summary field.

所以,现在,如果你不能看到喜欢,伯爵或评论栏,只需按以下步骤操作:

So now if you cannot see "count" in "likes" or "comments" field, just follow the steps below:

  1. 发送GET请求来,比方说 https://graph.facebook.com/microsoft/posts?fields=likes&limit=1&access_token= ,然后你得到的post_id =ID
  2. 在一个新的GET请求 https://graph.facebook.com/POST_ID/likes?summary=true&access_token= ,那么你会发现TOTAL_COUNT在摘要场喜欢的。
  1. Send a GET request to, let's say https://graph.facebook.com/microsoft/posts?fields=likes&limit=1&access_token= and then you get the POST_ID = "id"
  2. a new GET request to https://graph.facebook.com/POST_ID/likes?summary=true&access_token=, then you will find the "total_count" of "likes" in "summary" field.

希望这有助于!

这篇关于无法获取&QUOT; COUNT&QUOT;在&QUOT;喜欢&QUOT;和&QUOT;意见&QUOT;用我自己的注册应用程序的access_token领域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆