AlbatrosX
AlbatrosX

Reputation: 21

What is the mechanism that display my online friends?

I'm developing a game and i want display all online friend for a specific player.

I already would use a online status field in my player class and display all players and test who have the online status true.

Any suggestion please ?? can i simulate the mechanism used by Facebook to do that.

Thanks.

Upvotes: 1

Views: 69

Answers (1)

Adam Azad
Adam Azad

Reputation: 11297

FQL Query can return a array of active, idle and offline friends

SELECT uid, name, pic_square, online_presence
            FROM user
            WHERE online_presence IN ('active', 'idle')
            AND uid IN (
                SELECT uid2 FROM friend WHERE uid1 = me() 
            )

it requires the friends_online_presence permissions otherwise the data array would be NULL

Source: Fetch Online Friends List With Facebook Graph Api

Upvotes: 0

Related Questions