Loading...
Facebook developer toolkit!

Facebook developer toolkit!

Earlier today I was looking for a good set of facebook tools, for either C# or Delphi to develope some small facebook desktop applications and fell over The 'Facebook Developer Kit' on CodePlex! Apparenly the project has started, because Microsoft needed a framework for .net, which could interact with facebook, and a company named Clarity Consulting inc.got the job to develop such a toolkit for .net! Now the project is getting near to version 3.0! and the current release (2.1) works for both ASP.net applications and WinForms, and its really easy! From the project website:

Clarity Consulting Inc. http://www.claritycon.com developed the original Facebook Developer Toolkit for the Microsoft Visual Studio Express Team. We have seen great feedback and suggestions for improving the code base. We worked with Microsoft on an idea to keep the code relevant and up to date for all the Facebook Developers. Together we decided that hosting the source here on CodePlex will be the best way to track items and allow community involvement in the source. We encourage everyone to get involved.

I made a little application, to simply connect to facebook, this is how easy it is!

FacebookService fbService = new FacebookService();
fbService.ApplicationKey = ""; //your application key ... 
fbService.Secret = ""; //your fb application secret!
fbService.IsDesktopApplication = true;
try {
    fbService.ConnectToFacebook();
} catch { 
    //an error has occoured or the user aborted!
}

if (fbService.SessionKey != null)
{
    MainForm main = new MainForm(fbService);
    Application.Run(main); //the user has successfully logged into facebook!
}
else
{
    Application.Exit();
}

The user has now authenticated with facebook! and can begin to get events and such from the user. I wanted to get all the events, with name, event id, who planned the event and when it occurs! This was soo wasy!

//get a list with all the facebook events, of type facebook.Schema.facebookevent..
IList<fbEvents> = fbService.events.get();
//loop through the list
for (int i = 0; i < fbEvents.Count; i++) {
    //get the event on place i, and print out the information to a richTextbox!
    facebook.Schema.facebookevent aEvent = fbEvents.ElementAt(i);
    richTextBox1.Text += "\n" + i.ToString() + ":" + aEvent.name;
    richTextBox1.Text += "\n\t" + aEvent.location.ToString();
    richTextBox1.Text += "\n\t" + aEvent.eid;
    richTextBox1.Text += "\n\t" + "Start: " + aEvent.start_date.ToString();
    richTextBox1.Text += "\n\t" + "Ends: " + aEvent.end_date.ToString();
}

currently still fooling around with the basics, but applications for this will come soon! (including sync with outlook using VSOT!)

There are 0 comments

Add your comment