如何通过监听器获取Facebook SDK的实时状态通知 [英] How to get real-time status notification with Facebook SDK via listener
问题描述
我正在使用Twitter4j和Android Facebook SDK来获取状态消息。通过Twitter4J,每当通过 StatusListener
(Twitter4J)将新状态添加到流中时,我将获得实时通知。
在Facebook SDK中,我找不到类似的方式,我只能使用 RequestListener
(Facebook SDK)作为固定时间间隔一遍又一遍地获取整个流就像我看到的那样。
I'm using Twitter4j and the Android Facebook SDK to fetch status messages. With Twitter4J I get real-time notifications whenever a new status has been added to the stream via StatusListener
(Twitter4J).
In the Facebook SDK I cannot find a similar way, I can only fetch entire streams over and over again in a fixed time interval using RequestListener
(Facebook SDK) as far as I see it.
有没有办法通过Facebook SDK以与Twitter4J相似的方式实时获得新状态的通知?
Is there any way to get notified of new statuses in realtime with the Facebook SDK in a similar way as with Twitter4J?
(在这里找到一个类似但没有回答的问题: Facebook实时更新的应用程序墙
(Found a similar but unanswered question here: Facebook real-time updated application wall)
推荐答案
有一个实时API
http://developers.facebook.com/docs/api/realtime
,但它只适用于服务器到服务器的通信,所以如果您所拥有的是没有您的应用程序可以订阅的服务器基础设施的移动应用程序,这并不真正有用 - 这是什么在我的具体情况下寻找。
but it's only for server-to-server communication, so it's not really useful if all you have is a mobile app without a server infrastructure that your app can subscribed to - which is what I was looking for in my particular case.
请参阅 http://forum.developers.facebook.net/viewtopic.php?i d = 56610
这篇关于如何通过监听器获取Facebook SDK的实时状态通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!