Facebook.NET Update

A quick update on the release of Facebook.NET 0.3 with support for new and changing Facebook APIs...

Over the weekend I released the next version of Facebook.NET over on the CodePlex project site.

If you've built a Facebook application using my framework, you'll definitely want to check out this build. Facebook has deprecated the setFBML API as it currently exists (read about this on the developer blog), and I can't think of any application that isn't affected by this. To summarize the old signature, now marked obsolete, was effectively:

    SetFbml(string userID, string fbmlMarkup)
and the new signature has the FBML markup broken out into separate parameters:
    SetFbml(string userID, string profileMarkup, string actionsMarkup);
    SetFbml(string userID, string profileMarkup, string actionsMarkup, string mobileMarkup)
This actually makes constructing the FBML a bit more cleaner, as it keeps the different logical bits of markup separate. Facebook.NET has contained support for the new updated SetFbml API for a while now, but its now packaged as part of the 0.3 release. The old API goes out of service on the 17th, at which point I'll update the framework to completely remove the obsoleted API as well.

I love the fact that Facebook is able to announce changes to the API or mark things as deprecated when they need to, give some time to developers to allow them to catch up, and then actually go ahead and flip the switch to actually make the change. Relating this to the .NET Framework APIs and personal experience with the process, its certainly a luxury when if you can afford to do that. It certainly speaks to something about the dynamic nature of the Web, and the need for developers creating mashups or using services to keep up!

There are several other changes including several bug fixes that have been packaged up into this release, that you can read about on the project's page. These were also available in source code form during the past month.

  • The big one is support for creating applications for Facebook Pages. Facebook introduced the Page/Fan-of concept sometime back, which allow the page creator to add applications. Facebook.NET supports these applications. As an aside, there is a page for ASP.NET if you're on Facebook, and you'd like to declare yourself as a fan :-)
  • Various other APIs are now covered. These include detecting application permissions, storing application preferences, etc.
  • I've added a sample that demonstrates using Facebook.NET for creating desktop applications to complement the samples for the regular FBML/IFrame application styles.

I'll be creating a show case of applications using Facebook.NET soon. I know of a few, but if you'd like to submit your application to show up on the list, feel free to list it down here in the comments.

Posted on Sunday, 1/13/2008 @ 11:53 PM | #Facebook


Comments

9 comments have been posted.

Kevin Daly

Posted on 1/14/2008 @ 12:40 AM
Call me old fashioned (or just old), but personally I think of a published API as a contract: changes should be versioned.

Nikhil Kothari

Posted on 1/14/2008 @ 12:53 AM
Kevin, I agree with you to a large extent. Thats why I called it a luxury to have. However, at the same time, never breaking anything also has a price: complexity, confusion, size (if there are framework bits involved - not here in this case), and sometimes gets in the way of fundamental improvements. All said, I think this particular change could have been made in a backward compatible manner. Apparently facebook decided it was important enough a change to make to optimize FBML processing on its end.

In the end, like any other platform, Facebook hopefully will balance price and value and choose the "right" thing... given they have a significant number of developers building on their APIs.

vikram

Posted on 1/14/2008 @ 2:55 AM
pretty good to see the new work, But I also agree with kevin, versioning is very important on major breaking changes

Dave R.

Posted on 1/14/2008 @ 7:27 AM
Many thanks for the framework. It's been on my radar for a while and I'm looking forward to trying it out in anger.

You may not have noticed, but it looks like your Version.txt is out of date. In the 0.3.0.0 archive it still refers to the 0.2.1.0 release. No biggie, but thought you should know.

Keiji

Posted on 1/22/2008 @ 1:58 PM
Thanks for the framework Nikhil. I played with it and noticed that Fql.ExecuteQuery() returns JsonObjects. How can I make it return XML, or better yet, return strongly-typed objects (Eg. for 'user' XML node, return User object)?

Again, thank you for the framework and I look forward to its future versions.

Nikhil Kothari

Posted on 1/23/2008 @ 2:01 AM
Currently the strongly typed objects have internal ctors... they really ought to be public so that you can create instances of them using JsonObject.

Alternatively I've been thinking of an overload to Fql.ExecuteQuery that takes in an entity type to use when creating the results. That might work better overall, rather than making all the APIs public.

There is no way to get XML - Facebook.NET doesn't use XML - it only uses JSON, which is much better in various ways including having smaller payloads. This adds up if you're getting information about lots of users for example.

Nikhil

Posted on 1/29/2008 @ 5:55 AM
Hi Nikhil,

I had been a silent follower of your blog from around two years now and have also attended one of your session in Mumbai, India in 2006. I have downloaded and started working on FaceBookNet and have also downloaded MS Facebook Toolkit. Having evaluated both the frameworks i am not sure what should I be using for a full fledge application development as both seem to be promising. Although i am convined about using FacebookNet, could you please guide me deciding on what to use?

Thanking you in advance.

~ Regards
Nikhil K

Nikhil Kothari

Posted on 2/3/2008 @ 4:50 PM
I can't help but recommend Facebook.NET as the choice, but I might be biased. I'll say that Facebook.NET was designed to be more optimized for asp.net scenarios, but now supports desktop apps as well. Good Luck!

vmohar98

Posted on 3/17/2008 @ 5:00 AM
Hi Nikhil,

Thanks for a kickass framework and keeping it up-to-date with FB changes.

I have been looking for an API to get and set application cookies. I can get the application cookie using FQL - there are examples on FB wiki but I am not finding a way to set application cookie - may be I am missing something but what I am looking for is an equivalent of

$facebook->api_client->data_setCookie($user, 'connexID', $row['id'], 300, );

I can find "api_client" in php and java libs but not in facebook.net.

thanks
The discussion on this post has been closed. Please use my contact form to provide comments.