Facebook API real-time friends' online presence update

和自甴很熟 提交于 2019-12-01 14:04:25

问题


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
));

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.

My question is, how can I get a real-time update of status-change or online-presence change by my friends?

Please help. Thanks.


回答1:


You would either need to do that query periodically, or use an XMPP (Jabber) connection to get updates in real-time.



来源:https://stackoverflow.com/questions/5295829/facebook-api-real-time-friends-online-presence-update

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!