问题描述
我目前正在开发Facebook的应用程序里面有我的朋友列表以及他们的在线presence。为了得到这个,我用:
I'm currently developing an app in facebook which has a list of my friends and shows their online presence. To get this, I used:
$fql = "SELECT uid, name, online_presence, status FROM user WHERE uid IN ( SELECT uid2 FROM friend WHERE uid1 = '".$this->user_id."')";
$active = $this->facebook->api(array(
'method' => 'fql.query',
'query' =>$fql
));
不过,因为我在的时候,我打开我的应用程序只获得该信息(状态,在线presence),它会不会改变,直到我重装我的应用程序。
But since I'm only getting this information (status, online presence) at the time when I open my app, it'll not change until I reload my app.
我的问题是,我怎么能由我的朋友们的状态变化或online- presence变化的实时更新?
My question is, how can I get a real-time update of status-change or online-presence change by my friends?
请帮忙。谢谢你。
推荐答案
您要么需要定期做查询,或使用XMPP(Jabber的)连接来获取实时更新。
You would either need to do that query periodically, or use an XMPP (Jabber) connection to get updates in real-time.
这篇关于Facebook的API实时朋友的在线presence更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!