Facebook App Users List

后端 未结 2 969
攒了一身酷
攒了一身酷 2021-02-08 20:04

I am fairly new to the Facebook APIs. I want to get a list of my friends who have also installed my app. (The idea being you can then start a game with them).

This gives

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-08 20:20

    Use this query in JS

    function getAppFriends()
    {
    
        var fql = "SELECT uid, name, pic_square, is_app_user 
                   FROM user 
                   WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) 
                   OR uid IN(SELECT uid1 FROM friend WHERE uid2=me()) 
                   ORDER BY  name";
    
        var query = FB.Data.query(fql);
    
        query.wait(function(responseFromFb){
    
           if(responseFromFb!=null){
    
               // Read the responseFromFb and check for 
               // is_app_user = true and list them out the way 
               // you want to.
    
           }
    
        });// anonymus function closes here
    } //function ends here
    

提交回复
热议问题