I am new to Facebook API. I want to get a list of my friends who also installed my application. (The idea is that you can start the game with them). A.
This gives a list of my friends:
FB.api('/me/friends', ...
This gives information about my application:
FB.api('/myappid', ...
What I want is "my friends who also have this app installed"
I thought it could be like this:
FB.api('/myappid/accounts', ...
I was hoping to at least provide me with my developers, administrators, or testers, but that would not be such luck. http://developers.facebook.com/docs/test_users/ http://developers.facebook.com/docs/ApplicationSecurity/
My feeling, maybe I need to use FQL to construct a query that says something like
(psuedocode) SELECT FROM my_friends WHERE uid IN ( SELECT uid FROM app_users WHERE appid = myappid )
Any advice is appreciated.
Notice, I saw this post: FaceBook application: get a list of user IDs of my application
I keep a local list of Facebook user IDs that belong to my site, and I can really achieve my goal by following these steps, but I'm sure there should be a better way:
$facebookFriendIds = array(); $friends = $this->facebook->api('/me/friends'); foreach ($friends['data'] as $friend) { $facebookFriendIds[] = $friend['id']; } $this->friends = Doctrine_Core::getTable('User')->createQuery() ->whereIn('fb_user_id', $facebookFriendIds) ->execute();
facebook facebook-graph-api facebook-fql
captainclam
source share