脸书在线好友

发布于 2024-11-01 13:39:13 字数 750 浏览 6 评论 0原文

我尝试了一些在这里找到的解决方案来获取我的在线朋友列表:

Facebook FQL 查询使所有用户在线

如何通过 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

2024-11-08 13:39:13

您需要 user_status 权限来读取用户的状态,并需要 user_online_presence 和/或 friends_online_presence 权限来读取 online_presence

这里是完整的权限列表。

You need the user_status permission to read the user's status and user_online_presence and/or friends_online_presence permissions for the online_presence.

Here is the full permissions list.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文