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

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

问题描述

我正在Scala和Play!写一个Facebook应用程序。我想要用户Feed的实时更新和用户管理的页面的Feed,所以我订阅了这些。这是从GET / {my_app_id} /订阅回来的:

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

我的服务器收到有关使用我的应用程序的用户的Feed的更新(包括当他在自己的页面的墙上发布时),但是没有关于他管理的页面发布的帖子的更新。该应用程序被授予read_stream,user_status和manage_pages权限。问题是我可以获取页面Feed更新,而不用用户将我的应用程序作为选项卡添加到他的页面?我的应用程序不是用作标签应用程序。



简短的调查显示我实际上做了我的功课:
这里,支持工程师说这是可能的,虽然不清楚如何在创建订阅时使用与页面和应用程序相关的页面访问令牌。
另一方面, here CBroe说一个必须添加应用程序作为选项卡。 在这里 Caroline建议创建一个选项卡,并立即删除,看起来很丑陋。我试图添加我的应用程序作为选项卡,而不提示用户,如这个,使用Graph API Explorer,并获得应用程序没有此操作的权限。

解决方案

事实在于中间:必须制作POST以 https://graph.facebook.com/pageId/tabs?app_id=appId&access_token=page_access_token 获取网页的实时更新,但这似乎不会将应用添加为标签,该应用只是在页面设置中显示添加的应用程序。我通过Graph API资源管理器进行了POST,以调试我的更新处理代码,更新到达服务器。


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
  }
  ]
}

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.

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".

解决方案

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 page feed实时更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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