Console App without needed Login

Sep 28, 2009 at 8:27 AM

Hallo ive created a simply console App, because i need to send to some APP users notification once in a day (i have set up the app as a scheduled task in a specific time).

The only problem is that this application cannot run unless i create a session, with me entering my credentials.Cant this be done automatically so that this console app will run by its own and not needed to login first?



Sep 28, 2009 at 8:41 AM

I'm new at this stuff too, but as far as I understand it you can only update people's status/wall if they have granted you extended permissions, e.g. publish_stream + offline_access.

I wrote a simple WinForms app to allow me to grant these permissions on my account to my app - you then grab the client secret and session key supplied by facebook and then your app can run without further user input - see the Facebook Connect stuff for further info.

For example I push this url into a WebBrowserClient

return string.Format( @"{0}&connect_display=popup&v=1.0&next=,publish_stream,offline_access", ApplicationKey);

and then decode the JSON response to extract the client secret, user id and sessionKey.

The important thing is to make sure that you have marked your application as a desktop app on Facebook or it will give an "Invalid session" response.

Sep 28, 2009 at 9:15 AM

I understand.I wll try this trick you just told me.

But i guess you have to make a second application (as Desktop App) and get the key for that reason because my first Application is based on Web.

I am sending succesfully notification but i have to login first :(


Can i ask you get the response? By HttpResponse it?