Pratik
Pratik

Reputation: 13

Facebook open graph, filtering friends list array

I want my application to filter the friends list I get using the open graph. People who login into my site must see only their friends who also use my app. I've noticed this on many applications like Quora, Thumb etc. How can it be done using php?

Upvotes: 1

Views: 1728

Answers (2)

C3roe
C3roe

Reputation: 96151

Can easily be done when you use FQL to query the user table (in conjunction with the friend table) – that has a field is_app_user, so a query like

SELECT uid, name FROM user
WHERE uid IN (SELECT uid1 FROM friend WHERE uid2 = me())
AND is_app_user

will return only those friends of the current user that are also users of your app.

Upvotes: 5

ShawnDaGeek
ShawnDaGeek

Reputation: 4150

You can access the lists of a user by access the friendslist connection via graph api

example: http://developers.facebook.com/tools/explorer/?method=GET&path=me%2Ffriendlists

/me/friendlists?access_token='.$access_token.'

Upvotes: 1

Related Questions