Friday, April 8, 2011

The simplest way to customize Facebook pages

Display different content for fans, plus localize your page using the user language

Very often people want their Facebook pages to display pages in visitor language (Facebook configured language). Also, they want to display some content only if the current user is a fan (clicked the Like button).
There are a lot of solutions for localization and personalization on the Web, using Facebook applications, using FBML (now deprecated by Facebook since March 11th, 2011) and so on. These are interesting but I've found a better way to achieve all this.
In my article about Facebook pages localization I've talked about the signed_request parameter send by Facebook to an iframe application. The documentation was not so clear on the Facebook website, but seems that they did a much better job now: https://developers.facebook.com/docs/authentication/signed_request/
So if you read the value of the signed_request parameter and decode it, you will get a json string containing all the info needed to localize the content, plus some information about the page hosting the application, including a boolean value which tells if the current user liked the page or not. All this without for an application not requesting any additional permission from the user, so it will act like a regular tab on the page.
I'll get back soon with a step by step procedure to achieve Facebook pages customization.

UPDATE: Here is the step by step guide: http://www.marianborca.com/2011/04/how-to-customize-facebook-pages-step-by.html

No comments:

Post a Comment