GetFriendsAppUsersIds

Developer
May 15, 2008 at 8:04 PM
What are the chances of getting this method added to the main code.
I just need a list of the uid for friends that have the app installed.

I can use GetFriendsAppUsers, but that makes the extra call to fill in the User Object.
I can use GetFriendsAppUsersXML, but then I dont get the nice features of the LoadXMLDocument and ErrorCheck.
May 16, 2008 at 1:10 AM
Edited May 16, 2008 at 1:14 AM
I'm thinking you could use FQL to query that information pretty easily.

SELECT uid FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = @facebookId ) AND has_added_app=1;

Hope that helps.


Developer
May 16, 2008 at 6:13 PM
Well, that is the very close to the same query the is in GetFriendsAppUsersXML().
But, calling DirectFQLQuery() leaves me in the same situation as Calling GetFriendsAppUsersXML() directly.  It still doesn't go through LoadXMLDocument and ErrorCheck.

I thought I saw someone else post that I could get a list of FriendsId.  But, if someone has 1000 firends, and only 2 have my app installed, I dont want to go through 998 friends I dont need to.

You can get a list of friends back in formats:
1) GetFriendsXML - string - XML containing list of UserID's
2) GetFriendIds - Collection<string> - User Id's from #1 as a collection
3) GetFriends - Collection<User> - Users as full objects.  List of userid's to create comes from #1 with addition call made to get User info

You can get Friends in an app back in formats:
1) GetFriendsAppUsersXML - string - RAW xml for a list
2) GetFriendsAppUsers - Collection<User> - Users as full objects.List of userid's to create comes from #1 with addition call made to get User info

You can get Friends NOT in an app back in formats:
1) GetFriendsNonAppUsers - Collection<User> - Users as full objects.  Uses #3 from Friends and #1 in FriendsApps

It seems to me that all three should have the same options for returning back.
1) RAW XML
2) Collection<string> - Collection of UserId's
3) Collection<Users> - Collection of User objects

Also, friends NOT in an app.
Why cant that use the same Friends in a app query
SELECT uid FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1=_userId) AND is_app_user

accept add a NOT to the last part
SELECT uid FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1=userId) AND not is_app_user

accept with a