Take the 2-minute tour ×

I am using Facebook official PHP SDK.

I have came through other articles that $facebook->api('/me/friends?fields=installed,name&limit=5') able to get my the user's friends who have also use the web app.

but seem like Facebook is giving all the user's friends. I guess Facebook doesn't filter for me who are using the app and who are not using. Facebook only pass a "true" to the user's friend data, only if the friend has installed the app.

my problem is, what is the good way to filter those results? I don't feel like doing "for loop" to check the thousands of results (afraid performance impact on my app).

i have seen others doing it nicely, when i connect to their App, they show me my friends who also there.

Note: i am new to FB API

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

Following is the code written in Facebook default web app.

$app_using_friends = $facebook->api(array(
    'method' => 'fql.query',
    'query' => 'SELECT uid, name FROM user WHERE uid IN(SELECT uid2 FROM friend WHERE uid1 = me()) AND is_app_user = 1'
share|improve this answer
okay. thanks. i will try and confirm your answer :) –  Tian Loon Jul 16 '13 at 6:36
add comment

Your Answer


