Developing a Facebook application

Chinese proverb: ‘May you live in interesting times’. Yes, I know it’s meant as a sugar-coated insult. Yet developing a Facebook app has been exactly that … interesting. Luckily as a developer I prevailed, but it didn’t happen overnight.

I am going to assume you have heard of Facebook. It offers a wonderful way for any website, any desktop application even, to integrate with them. To do this they offer an API. In itself the API is quite good. It’s RESTful which we like and the calls are clean enough. There are just so many of them.

The basic idea is this: as a Bemba user you wish to connect your Shared Pages to Facebook. So I have built a new page under Settings which allows you to go to their site and grant permission for the hook-up. Facebook works similar to Hyves, in that they force you to go to their website and log in there (opposed to Twitter, which allows username/password to be stored elsewhere).

I won’t go into detail about this choice since either one makes sense to me.

What was unclear though is that we needed to have an actual “facebook application” to work with. Our service does not have a real need for an application; we just want to make the API call to insert a story into a user’s News Feed. Facebook even offers a ‘login only’ mode which gives us all the information we need. But after much, much trial and error it turned out that, yes we really do need the user to install an application on Facebook. Much of these things are not documented, so you’re left to the forums.

Then we were left with the library to use. With things like these it makes no sense to develop everything from scratch. The API signature alone would be a massive reinvention of the wheel; pure waste of money. But … there are actually two Facebook libraries for Ruby on Rails. And naturally, you’re bound to pick the wrong one.

Actually, my colleage Frank picked the right one — ie the one that’s under recent development. Unfortunately, at the time we assumed that a login would be all that’s required. And this was handled much more gracefully in the other library. So after changing to that one, and after trial and error changing back to the correct one, we could proceed.

Only then you’re left with the actual contents of the API call. It turns out that Facebook does some hefty checking on its contents. ‘Cause if you comply to their standards, you have a higher chance of appearing in friend’s mini feeds. This also has been a trial and error process, and even now we’re still fine-tuning this.

All in all we spent a hideous amount of time for the Facebook connection, but even after a few hours it was totally worth it. We have seen people installing the app, becoming Fan of it and using the connection in general. It’s great, nee awesome to see all those red Bs in Facebook. I guess it is sortof like giving birth — you quickly forget the pain and are left with a feeling of great joy.

I am glad the Bemba-to-Facebook connection is working. See it in action yourself by visiting your settings page. You do have a Facebook account, dontcha?

1 Response to “Developing a Facebook application”


  1. 1 Sander May 25th, 2008 at 10:22 pm

    Done. Nu mijn Bemba feed bekijken :-) En wat facebook vrienden zoeken.

Leave a Reply




About Bemba Media

Bemba Media is a new social media company based in Amsterdam, the Netherlands. Founders Aaron Peters and Arne Dibbits are on a mission to offer people the easiest way to share their web experiences with friends and to discover what’s hot on the web right now.

The company launched Bemba.com in March 2008.

Bemba users share their favorite videos and websites on the social platforms they already use with their friends, like Facebook, Twitter and Hyves. More social networks and (micro-) blogs will follow.

Bemba will become a destination for 'funsurfing' the web, providing easy access to web content that people with similar interests have recently recommended to their friends.

Flickr photos

meeting with Sanoma NL in Hoofddorp #

Bemba blog in Wordle

More Photos

Twitter updates

    Recent readers