Is it possible to subscribe to real-time updates f

2019-07-20 22:27发布

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?

2条回答
相关推荐>>
2楼-- · 2019-07-20 23:05

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!

查看更多
Deceive 欺骗
3楼-- · 2019-07-20 23:12

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.

查看更多
登录 后发表回答