raja
raja

Reputation: 49

facebook landing page

i have one problem with facebook landing page. i created facebook landing page through static fbml app but i have one problem with like button, user must like the page before he will navigate to another page. i want to do same functionality in my landing page, http://www.facebook.com/BusinessofCinema?v=app_6009294086.

anyone know about this please help me .

thanks inadvance......

Upvotes: 1

Views: 441

Answers (2)

Krystian Cybulski
Krystian Cybulski

Reputation: 11118

Now that iframes are the only way to create new Facebook apps and FBML is being phased out, you need a new way to do it.

When your app URL is loaded, it is passed a signed_request POST parameter. This parameter contains the information you need. However, it is packed and encoded so it requires some manipulation to get the right info out.

  1. First, split the signed_request on the '.' character. The first part is the signature. The second part is the encoded_data
  2. Decode the encoded_data into a JSON string using the URLBase64Decode function equivalent in your server-side programming language
  3. The JSON object contains a node called "page". This contains a node called "liked".
  4. If "liked" is true, the user liked the page and you display the "liked" version of your app. If false, show the "Please like me" version of the site.

The FBML way will continue to work the way you have it live right now, but for anyone building a new Facebook app, this is the way to do.

Upvotes: 0

Mirko Froehlich
Mirko Froehlich

Reputation: 12046

At this point you'll probably want to go with iframe based Facebook page tabs instead, now that these have become available and fbml based apps are being phased out. Among other advantages, the signed_request parameter that Facebook sends to an iframe based tab app includes a flag that indicates whether the user is a fan of the page.

Upvotes: 1

Related Questions