是否可以订阅用户在线对话的实时更新? [英] Is it possible to subscribe to real-time updates for user online_presence?

查看:104
本文介绍了是否可以订阅用户在线对话的实时更新?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序有搜索功能,可以根据各种过滤条件找到用户。

My app has a search where you can find users based on various filters.

我最近添加了一个指示器,以便您可以看到用户是否在线。我通过获取user_online_presence权限来完成此工作,然后在结果被过滤之后,与我在数据库中存储的用户access_token进行了一个FQL请求。

I recently added an indicator so you could see whether or not a user was online. I made this work by getting the user_online_presence permission, then after the results were filtered, making an FQL request with the users access_token, which I have stored in my database.

现在,我想要这样做,所以我可以根据用户是否登录过滤搜索。所以我需要让每个用户的在线状态存储在我的数据库中。

Now, I want to make it so I can actually filter the search based on whether or not a user is signed in. So somehow, I need to have each user's online presence stored in my database.

这似乎是什么实时更新,但Facebook不列出在线对话作为我可以订阅的东西。

This seems to be what real-time updates are for, but Facebook doesn't list online_presence as something I can subscribe to.

https:// developers.facebook.com/docs/reference/api/realtime/ ,他们说:
您可以订阅除验证之外的所有User对象属性。

On https://developers.facebook.com/docs/reference/api/realtime/ , they say: "You can subscribe to all of the User object properties except verified."

但是,online_presence未列为用户字段:
https://developers.facebook.com/docs/reference/api/user/

But online_presence isn't listed as a User field: https://developers.facebook.com/docs/reference/api/user/

有没有人尝试过这个?

推荐答案

绝对是用户表的字段或下面的查询不起作用。

It most definitely is a field of the user table or the below query would not work.

SELECT uid, name, pic_square, online_presence FROM user

,其唯一列在:
https://developers.facebook.com / docs / reference / fql / user /

而不是:
https://developers.facebook.com/docs/reference/api/user/

当面对这种问题时,我通常会通过阅读两个文档的笔记来阅读。

When faced with this kind of question, I usually resort to reading through the notes on both documentations.

然后,我发现:您可以缓存这些数据,并在任何字段上订阅实时更新,这些字段也是相应Graph API版本的字段。 - Facebook

I then found this: "You can cache this data and subscribe to real time updates on any of its fields which are also fields in the corresponding Graph API version." - Facebook

所以基本上,他们说它不会工作,除非这两个环节都存在。

So basically, they're saying that it wont work unless the field exists in both links.

然后我会试试这个问题的答案,我发现:

I would then instead try out the answer in this Question that I found:

Facebook API实时好友的在线状态更新

我希望至少澄清事情有点为你祝你好运!

I hope this at least clarified things a bit for you. Best of luck!

这篇关于是否可以订阅用户在线对话的实时更新?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆