Sunday, December 19, 2010

Silverlight with Facebook - a practical guide to integration

Foreword
This article discusses how basic Facebook features (such as logging in, posting to a user’s wall) can be accessed from within your Silverlight application. Since we will be discussing the topic of integrating Facebook with Silverlight, understanding the article requires that you have some basic knowledge of the two.

Note: this is a guest article, written by a co-worker, Balázs Cseh. It uses an older version of the Facebook API.

The Goal - Harnessing the power of social networks

Social networks have grown to be a really important factor to consider when you are building any sort of publicly available application - and the biggest one out there is almost certainly Facebook. According to some of its own statistics, it has more than 500 million (yes, that's no exaggeration) active users, half of which log on to Facebook every day. Those 500 million users each have 130 friends on average. That means, that getting any one of those 500 million to use your application, might lead to 130 more learning about it, 130 more people each having 130 more friends they can bring and so on. You will probably agree with me, that this alone is a pretty strong argument for connecting your application to Facebook.
What makes the above statistics particularly interesting is that Facebook not only has such a huge user database, it also allows us software developers to harness the power of this enormous social network.
Facebook offers a wide range of integration options. Ranging from a simple 'I like this website' button that you can place on your website to more in-depth, behind the scenes access to their social network database.

Facebook integration is a huge topic and you can find some really detailed information about it in the Facebook developer documentation. I suggest you spend some time reading that documentation, as to get an idea of what Facebook has to offer. While it is not listed in the official Facebook documentation, a .NET based Facebook SDK is available. The project and wrapper mentioned in this article uses the 3.1 version of this SDK.

The Task

To get you started on the bumpy but rewarding road of Facebook integration, we will discuss the tasks and challenges we faced when we created the Silverlight application for displaying the gigapixel panorama image created during the Hungary - San Marino football match. (The website is in Hungarian).

Read more: Dotneteers