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