Facebook friends

ive tried some solution found here to get a list of my friends on the internet:

Facebook FQL query for all online users

How to get friends list online using FQL with facebook API?

this is my fql request:

$fql = "SELECT uid, name, online_presence, status FROM user WHERE uid IN ( SELECT uid2 FROM friend WHERE uid1 = '".$me['id']."')"; 

But the field of presence is empty for 99% of my friends. I get a presence (active, free, autonomous), only for friends 6/7. same for the status field.

How can I get full presence and status data? What am I missing? I need to request a specific permission for my application (currently I only have a basic one).

Many thanks.

EDIT: @ Roozbeh15's solution is the answer, but I need to find out why the result does not match the same number of users as in the chat. The fql user counter is always equal to <than the user in the fb chat. Do you know, why?

+3
source share
1 answer

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

Here is a complete list of permissions.

+8
source

Source: https://habr.com/ru/post/1311975/


All Articles