开发者

Can the Facebook Graph API supply me an array of friends who use an app I created?

开发者 https://www.devze.com 2023-03-16 11:27 出处:网络
I\'m trying to find any information that shows how I can get a list of friends w开发者_如何学编程ho use a facebook app I created. Is that possible?You can use the follow FQL query:

I'm trying to find any information that shows how I can get a list of friends w开发者_如何学编程ho use a facebook app I created. Is that possible?


You can use the follow FQL query:

SELECT uid, name FROM user WHERE has_added_app=1 
and uid IN (SELECT uid2 FROM friend WHERE uid1 = me())

This will be better than using the deprecated old REST api method.


Think this is what you are looking for : friends.getAppUsers


You can also use GET method to retrieve the json object

    $friends = json_decode(file_get_contents("https://graph.facebook.com/$fbid/friends?access_token=" . $cookie['access_token']), true);
    $friends = $friends['data'];
    foreach($friends as $a => $b) {
    $the_id = $b['id'];
    echo $b['name'];
    }
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号