donderdag, oktober 30, 2008

 

Making a Facebook application


I've been working on a Facebook application that uses trivia questions from this site. I intended it to be a real social application, so not just another way of doing trivia quizzes on your own just like you can do on about2findout. It's called FriendsIQ, and it tests the combined smarts of yourself and your network of friends, and above all your capability to know what to ask to who.

I found that debugging a social application takes more time than debugging a regular one, specially since you're not allowed to have a multitude of Facebook users to test with. I'm still working on some bugs.

There are two ways to create a Facebook application: in FBML (Facebook's own markup language) or via an iframe. An iframe is basically a piece of the browser window that gets its content from an independent other site. And that's what I used. So on FriendsIQ, what you see is actually pages that are on my own site about2findout.com within the Facebook canvas. Either way you first have to register your application on Facebook and apply for an application and secret key. (And that is fast and free.)

As the site is written in asp.net, I needed components to create Facebook applications on that platform. I wasted a day trying to get the Facebook Toolkit to work. It's an open source project on Codeplex, and a further evolution of Microsoft's toolkit. And it might be a great thing, but it's just too damn hard for a non-die hard programmer to get it to work, specially since Facebook itself has changed quite a lot. The samples don't work, and there is no documentation to get you started. You need to search for hours on the internet to figure out how it works. So I leave the toolkit for those who know how to read the source code and figure it all out, and switched to the much simpler Facebook.NET, also hosted as an open source on Codeplex. I got the major things working, although the new way of handling feed messages is not supported in this project (yet).

Here are some links that really saved me hours of headaches and got me started:
http://www.stevetrefethen.com/blog/VSNETStarterKitForNikhilKotharisFacebookNET.aspx
http://www.nikhilk.net/FacebookNET.aspx
http://www.marketing-ninja.com/old-stuff/why-im-switching-to-facebooknet-from-the-facebook-developers-toolit/
http://www.marketing-ninja.com/old-stuff/5-facebooknet-development-tips/

Labels: , , ,