Pergunta

Everything is set up just fine. I can receive and log the data that facebook pushes to my callback server.

I'm monitoring the feed for updates, specifically posts. When I post as the page, I can get the post_id and call the graph api to get the details.

When I post as a user to the page I get this information:

{
   "object":"page",
   "entry":[
      {
         "id":"**[PAGE ID]**",
         "time":1385465393,
         "changes":[
            {
               "field":"feed",
               "value":{
                  "item":"post",
                  "verb":"add",
                  "post_id":**[INVALID POST ID]**,
                  "sender_id":**[USER WHO SENT POST]**
               }
            }
         ]
  }
   ]
}

Which is the typical output. Note that I have removed the identifiers and replaced them with placer holders.

When I extract the post_id and query it using the graph API it returns the following message:

{ "error": { "message": "Unsupported get request.", "type": "GraphMethodException", "code": 100 } }

I have:

  • Validated my page access token using the debugger (this has manage_pages permissions associated with it and is permanent)
  • Queried the graph API -> [My Page ID]/feed returns the posts I want to retrieve but their post id's are different to the ones I have been sent by Facebook.
  • Created a fresh user account in case it was an issue with Facebook's spam detector (maybe my many tests post had triggered the spam filter?) but to no avail.
  • Ensured that my page allows users of age 13+ and has no country restrictions
  • Ensured app is not in sandbox mode
  • Ensured there weren't any silly permission issues in the app configuration such as alcohol page or not having the age set to 13+

So I'm stumped.

Why is Facebook not sending me the correct post_id? Why is it sending me one that is invalid? And how do I get around this considering my app is central to the use of real time updates?

Foi útil?

Solução

So this turned out to be a facebook-related issue. I basically had to modify my code to take into account that RTU sent you a differently formatted post ID depending on whether you were a page administrator or an average user.

If you're a page admin the format of the page ID will be [PAGE ID]**_[POST ID]**, but if you're an average user RTU will just send you the post ID without the page ID prefixed.

A little bit confusing... Not sure if a bug has been filed with Facebook just yet.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top