Retrieve list of friends with offline access

May 20, 2009 at 2:21 PM


We are trying to retrieve the list of friends of a user that has accepted the 'offline access' permissions to our application.

Here is our code but when executing it, we have the following exception "Session key invalid or no longer valid:"


                            facebook.API api = new facebook.API();
                            api.IsDesktopApplication = true;
                            api.ApplicationKey = "<appkey>";
                            api.Secret = "<secretkey>";
                            System.Collections.Generic.Dictionary<string, string> parameters = new System.Collections.Generic.Dictionary<string, string>();
                            parameters.Add("method", "Fql.query");
                            parameters.Add("query", "SELECT uid2 FROM friend WHERE uid1 = '<userid>'");
                            string res = api.SendRequest(parameters, false);
                        catch (Exception ex)



We tried also to create an authentication token but  an exception "invalid parameter" is thrown on trying to create the session

try { 
facebook.Components.FacebookService fbs = new
fbs.ApplicationKey = "the API Key";
fbs.Secret = "The application Secret";
} catch (Exception ex) {

Any idea?

Thanks a lot,

( fbs.CreateSession(fbs.API.AuthToken);)