Find Friends ID without friends.getUserObjects()

Jan 18, 2009 at 5:10 PM
Hi all
i need to find all user's friends ID
i can do it with fbservice.friends.getUserObjects() but unfortunatly this mehod returns al lot of informations that i don't need and it also reduces performance of my application
Any suggestion?
thank you
Jan 19, 2009 at 2:42 PM
Edited Jan 19, 2009 at 2:42 PM
Try using the friends.get method. (  The getUserObjects() method calls the friends.get() method under the covers and then calls the users object to get the additional data about the friends.

Let me know if this helps.


Jan 24, 2009 at 1:11 PM
it works fine and fast now
thank you very much
Jan 30, 2009 at 4:45 PM
Hey guys...

Can you post your code on how you got this working?

Thank you
Feb 14, 2009 at 12:29 AM
HI All
i'm sorry if i answer only now but i was out for works

This is my class for the facebook service



class FaceBookService




readonly FacebookService FBService = new FacebookService();
private string FACEBOOK_API_KEY = ConfigurationManager.AppSettings["APIKey"];
private string FACEBOOK_SECRET = ConfigurationManager.AppSettings["Secret"];




public FacebookService FBServiceApp()




HttpContext.Current.Session["APIKey"] = ConfigurationManager.AppSettings["APIKey"];
HttpContext.Current.Session["Secret"] = ConfigurationManager.AppSettings["Secret"];
FBService.ApplicationKey = FACEBOOK_API_KEY;
FBService.IsDesktopApplication =
string sessionKey = HttpContext.Current.Session["facebook_session_key"] as String;
long userId = HttpContext.Current.Session["facebook_userId"] is long ? (long)HttpContext.Current.Session["facebook_userId"] : 0L;



// When the user uses the facebook login page, the redirect back here will will have the auth_token in the query params
string authToken = HttpContext.Current.Request.QueryString["auth_token"];
if (!String.IsNullOrEmpty(sessionKey))



// We have already established a session on behalf of this user
FBService.SessionKey = sessionKey;
FBService.uid = userId;
else if (!String.IsNullOrEmpty(authToken))



// This will be executed when facebook login redirects to our page
HttpContext.Current.Session["facebook_session_key"] = FBService.SessionKey;
HttpContext.Current.Session["facebook_userId"] = FBService.uid;
HttpContext.Current.Session["facebook_session_expires"] = FBService.SessionExpires;



else // Need to login
HttpContext.Current.Response.Redirect(@"" + FBService.ApplicationKey + @"&v=1.0");
return null;
return FBService;




And this is how i obtain friend id in my pages



FacebookService fbservice = new FaceBookService().FBServiceApp();
IList<long> IListfriendsList = fbservice.friends.get();