无法通过实时更新 API 订阅页面的点赞
当我的应用程序所在页面的点赞数更新时,我试图获取更新。我试图通过使用 FB 实时更新 API 来实现此
目的我使用 object =“page”和 fields =“likes”执行 POST,收到 400 错误,并显示消息““likes”是无效的字段名称”。
object =“page”和 fields =“name”工作正常。
该文档声明您可以订阅任何公共属性。
对于那些玩家庭游戏的人,以下是重现问题的步骤:
为您的应用获取 OAuth 令牌:
https://graph.facebook.com/oauth/access_token?client_id=
&client_secret= &grant_type=client_credentials 发布到订阅 URL:
https://graph.facebook.com/
/subscriptions
POST 变量:
'access_token' => `<access token from step 1>`,
'object' => 'page',
'fields' => 'likes',
'callback_url' => `<a callback url>`,
'verify_token' => 'testingstring123'
I am trying to get updates when the like count of a page my app is on is updated. I am trying to accomplish this by using the FB Real-time Updates API
When I do a POST, with the object = "page" and the fields = "likes", I get a 400 error with the message '"likes" is an invalid field name'.
object = "page" and the fields = "name" works fine.
The documentation states you are allowed to subscribe to any public attribute.
For those playing the home game, here are the steps to reproduce the problem:
Get an OAuth token for your app:
https://graph.facebook.com/oauth/access_token?client_id=<app_id>&client_secret=<secret>&grant_type=client_credentials
Post to subscription URL:
https://graph.facebook.com/<app_id>/subscriptions
POST Variables:
'access_token' => `<access token from step 1>`,
'object' => 'page',
'fields' => 'likes',
'callback_url' => `<a callback url>`,
'verify_token' => 'testingstring123'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不支持此功能 - 来自 https:// 上的“实时更新”部分Developers.facebook.com/docs/reference/api/page/ :
This isn't supported - from the section 'Real-time Updates' on https://developers.facebook.com/docs/reference/api/page/ :
订阅“喜欢”仅适用于用户喜欢的页面。 “喜欢”对象是用户或页面喜欢的页面,而不是有多少人喜欢您的页面(无法订阅)。
Subscribing to likes is only for pages that a user likes. The 'likes' object is what pages a user or page likes, not the count of how many people like your page, which cannot be subscribed to.