脸书在线好友
我尝试了一些在这里找到的解决方案来获取我的在线朋友列表:
如何通过 facebook API 使用 FQL 获取在线好友列表?
这是我的 fql 查询:
$fql = "SELECT uid, name, online_presence, status FROM user WHERE uid IN
( SELECT uid2 FROM friend WHERE uid1 = '".$me['id']."')";
但是我 99% 的好友的状态字段为空。我得到的状态(活跃、空闲、离线),仅适用于 6/7 的朋友。状态字段也是如此。
我如何获得完整的状态数据?我缺少什么?我需要为我的应用程序请求特定权限(目前我只有基本权限)。
非常感谢。
编辑:@Roozbeh15 解决方案就是答案,但我需要找出为什么结果与我在聊天中的用户数量不同。 fql 用户数始终 <比 Facebook 聊天中的用户还要多。你知道为什么吗?
ive tryed some solution found here to get a list of my friend online:
Facebook FQL query to get all users online
How to get list of online friends using FQL with facebook API?
this is my fql query:
$fql = "SELECT uid, name, online_presence, status FROM user WHERE uid IN
( SELECT uid2 FROM friend WHERE uid1 = '".$me['id']."')";
But the presence field is empty for 99% of my friends. I get the presence (active, idle, offline), only for 6/7 friends. the same for the status field.
How i can get the complete presence and status data? What i'm missing? I need to request a particular permission for my app (currently i have only the basic).
Thank you very much.
EDIT: The @Roozbeh15 solution is the answer, but i need to fid why the result isn't the same number of user i hvae in chat. The fql user count is always < than the user in fb chat. Do you know why?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要
user_status
权限来读取用户的状态,并需要user_online_presence
和/或friends_online_presence
权限来读取online_presence
。这里是完整的权限列表。
You need the
user_status
permission to read the user's status anduser_online_presence
and/orfriends_online_presence
permissions for theonline_presence
.Here is the full permissions list.