Is it possible to “Like” a “fan page” using the Facebook SDK?

前端 未结 3 1691
无人共我
无人共我 2020-12-17 20:16

I am trying to let users \"like\" a Facebook fan page from within an Android app. I am able to successfully \"like\" objects such as wall comments using code like this,

相关标签:
3条回答
  • 2020-12-17 20:40

    Unfortunately, as far as I know so far, you can't like Pages via the API. You can render a Like button via a web view, but I think you're out of luck here at least. You can (as you note) like comments and posts, but pages still require direct user interaction.

    0 讨论(0)
  • 2020-12-17 20:50

    The Facebook documentation for Pages has been updated and is current (see https://developers.facebook.com/docs/reference/api/page/). You cannot like a Page via the Graph API, even though you can read the like count information.

    0 讨论(0)
  • 2020-12-17 20:51

    As other answers say, it is not possible to 'like' pages via the Graph API.

    The confusion in this topic comes from the API documentation, where is says You can comment on or like any object that has a /comments or /likes connection (The key term here is connection)

    Going a little deeper: Any object (in this case a Page), has a number of Fields and Connections. Fields are basically used to access the object information and Connections are used to perform operations in that object.

    In sum, a Page doesn't have a /likes Connection, but it has a /likes Field, reason why we can get the number of likes of a given page, but we cannot like a page.

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