Is it possible to subscribe to real-time updates for user online_presence?

℡╲_俬逩灬. 提交于 2019-12-11 03:06:14

问题


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

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.

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

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

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

Has anyone tried this?


回答1:


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

However, its only listed in: https://developers.facebook.com/docs/reference/fql/user/

and not in: 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.

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 real-time friends' online presence update

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




回答2:


Per my question here (https://stackoverflow.com/questions/27222641/fetch-online-presence-for-thousands-of-facebook-app-users), last week I heard directly from Facebook that this is not possible, and there are no plans to make it possible. Hope this helps. Still looking for the best way to get this information.



来源:https://stackoverflow.com/questions/11697243/is-it-possible-to-subscribe-to-real-time-updates-for-user-online-presence

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