how to get all my facebook application users?

耗尽温柔 提交于 2019-12-06 07:00:04

问题


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?


回答1:


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




回答2:


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:


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 + ")";                            


来源:https://stackoverflow.com/questions/5521457/how-to-get-all-my-facebook-application-users

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!