Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook online friend

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?

like image 876
Laphroaig Avatar asked Nov 30 '25 14:11

Laphroaig


1 Answers

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.

like image 54
Roozbeh15 Avatar answered Dec 03 '25 04:12

Roozbeh15



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!