Facebook App Users List

后端 未结 2 968
攒了一身酷
攒了一身酷 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条回答
  • 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
    
    0 讨论(0)
  • 2021-02-08 20:39

    This is I believe the FQL query

    $facebook->api(array('method' => 'fql.query', 'query' => "SELECT uid FROM user WHERE is_app_user = '1' AND uid IN (SELECT uid2 FROM friend WHERE uid1 = '" . $user_id . "');"));

    (I use java and JS APIs so the syntax may not be exactly correct)

    The documentation for the user and friend queries are here:

    http://developers.facebook.com/docs/reference/fql/user/

    http://developers.facebook.com/docs/reference/fql/friend/

    0 讨论(0)
提交回复
热议问题