Facebook Graph API returns 'false' even though post is public

后端 未结 3 1546
野性不改
野性不改 2020-12-15 01:48

In my application, most public posts seem to return \'false\' when accessed via the Graph API.

Example: https://graph.facebook.com/1543370206_2215254431220?access_to

相关标签:
3条回答
  • 2020-12-15 01:50

    I think I've solved it.

    The posts which were returning false aren't 'public' as such. They seem to be visible to any Facebook user, regardless of whether they're friends with the author. However, if you're not logged into Facebook, you can't see them.

    The posts which were succeeding were truly public. Most of them belonged to companies etc and you could see them whether you were logged into Facebook or not.

    I guess the Graph API makes a distinction between these two types of visibilities e.g. 'Everyone on Facebook' and 'Everyone on the Internet'. I had a look in my privacy settings and can't figure out how this has been done.

    Regardless, this isn't well-documented in the Graph API docs. Nor is returning 'false' an elegant way to handle this error. Nor is it consistent to allow me to see the post via search, but not query the object directly.

    0 讨论(0)
  • 2020-12-15 01:59

    I know this question is more then one year old - but Graph will return the correct object, if you use a Page access token.

    You get those by asking the user for MANAGE_PAGES permission, and then fetching the /Account connection on the user. Each entry in the connection will contain a pageid and a page-specific access token - this token will let you fetch all the page objects from the graph. If you use the your app-token, or users own token, it will return false.

    0 讨论(0)
  • 2020-12-15 02:15

    You should consider filing a bug report with Facebook. To add to the issue, I've noticed that these public posts only return false if they are posts by a user object. Posts by page objects work as expected. You are not doing anything wrong, as this is happening in Facebook's Graph API Explorer(this is the example Facebook provides in their API doc for querying public posts).

    0 讨论(0)
提交回复
热议问题