how to get all my facebook application users?

2019-04-10 10:32发布

I want to get the list of users who have connected to the app. Is there a way to do it using FQL or Graph API?

3条回答
2楼-- · 2019-04-10 10:45

I used this and works fine. This will get you a lists of your friends who have approved the app, not all the users

function getUsersApplication(){
    var url = "https://api.facebook.com/method/friends.getAppUsers?access_token="+FB.getAccessToken();
    $.ajax( {
        url : url,
        type : 'GET',
        dataType : 'text',
        data : null,
        success : function(data) {
        alert(data);
        }
    });
}
查看更多
贼婆χ
3楼-- · 2019-04-10 10:47

This works for me, here is an AS3 example:

var fql:String = "select pic_square, uid, first_name from user where is_app_user = 1 and uid IN(SELECT uid2 FROM friend WHERE uid1 =" + Facebook.getSession().uid + ")";                            
查看更多
狗以群分
4楼-- · 2019-04-10 10:56

With FQL, just do :

$fql="SELECT uid FROM user
WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = ".$me['id'].")
AND is_app_user = 1";

This is self explanatory.

AFAIK, its not possible via GRAPH API

查看更多
登录 后发表回答