订阅 facebook 页面提要实时更新 [英] Subscribe to facebook page feed real time updates

查看:22
本文介绍了订阅 facebook 页面提要实时更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用 Scala 和 Play 编写 Facebook 应用程序!.我想要用户提要和该用户管理的页面提要的实时更新,所以我订阅了这些.这是从 GET/{my_app_id}/subscriptions 返回的内容:

I'm writing a facebook app in Scala and Play!. I want real time updates for user feed and feed of pages this user administers, so I subscribed to those. This is what comes back from GET /{my_app_id}/subscriptions:

{
  "data": [
  {
    "object": "user", 
    "callback_url": "***", 
    "fields": [
      "feed"
    ], 
    "active": true
  }, 
  {
    "object": "page", 
    "callback_url": "***", 
    "fields": [
      "feed"
    ], 
    "active": true
  }
  ]
}

我的服务器接收有关使用我的应用程序的用户的提要的更新(包括当他以自己的身份在他的页面墙上发帖时),但没有关于他管理的页面所做的帖子的更新.应用程序被授予 read_stream、user_status 和 manage_pages 权限.问题是我能否在不让用户将我的应用作为选项卡添加到他的页面的情况下获取页面提要更新?我的应用程序不打算用作选项卡应用程序.

My server receives updates about the feed of the user that uses my app (including when he posts on his page's wall as himself), but no updates about posts made by the page he administers. The application is granted read_stream, user_status and manage_pages permissions. The question is can I get page feed updates without having the user add my app as a tab to his page? My app is not meant to be used as a tab app.

显示我确实做了功课的简短调查:此处 支持工程师说这是可能的,尽管不清楚如何使用创建订阅时绑定到页面和应用程序的页面访问令牌".另一方面,此处 CBroe 说必须添加应用程序作为选项卡.此处 Caroline 建议创建一个选项卡并立即将其删除,这看起来很难看.我尝试将我的应用程序添加为选项卡而不提示用户,例如 this,使用 Graph API Explorer 并得到应用程序无权执行此操作".

Short survey to show I actually did my homework: here the support engineer says it is possible, although it is unclear how to "use a Page Access Token tied to the both the Page and app when creating the subscription". On the other hand, here CBroe says one has to add app as a tab. Here Caroline suggests to create a tab and delete it immediately, which looks ugly. I tried to add my app as a tab without prompting the user, like this, with the Graph API Explorer and got "Application does not have permission for this action".

推荐答案

真相就在中间:一个人必须向 https://graph.facebook.com/pageId/tabs?app_id=appId&access_token=page_access_token 获取页面的实时更新,但这似乎没有添加作为选项卡的应用程序,该应用程序仅显示在页面设置中添加的应用程序中.我通过 Graph API explorer 进行了 POST 来调试我的更新处理代码,并且更新到达服务器正常.

The truth lies in the middle: one has to make a POST to https://graph.facebook.com/pageId/tabs?app_id=appId&access_token=page_access_token to get real time updates for the page, but this does not seem to add an app as a tab, the app just shows up among added apps in page settings. I did the POST through Graph API explorer to debug my update processing code, and the updates get to the server OK.

这篇关于订阅 facebook 页面提要实时更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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