Reputation: 77
I was wondering how do they create the page on facebook with like button as a gateway to enter and browse through the page...
Here is the one example.... http://www.facebook.com/Diesel?sk=app_168523776552050
I know how to create page in iframe and put in in facebook but I dont know how they show this popup and how do they show it for non fan visitors.
Please enlighten me with your ideas and works.....
Upvotes: 1
Views: 3656
Reputation: 123560
Parse the 'signed_request' parameter from Facebook. See http://developers.facebook.com/docs/howtos/login/signed-request/
Each signed request contains a 'page' key with a 'liked' subkey whose value is a bool of whether the page has been liked.
Display the banner depending on the value of that bool.
Note that only the Page Tab view has a like button on it. The Canvas App does not have a like button surrounding it.
Upvotes: 0
Reputation: 392
try this:
'signed request' will tell you whether the user is fan or not
write some code: if (user is fan) { show content for fans } else { show content for visitors }
Nothing happens without the 'signed request'. Works in PHP and JS.
Upvotes: 0
Reputation: 30773
This is a simple "Fan Gate", and on the none-fan version they show the normal like button via the url of the page.
A simple way to build a fan gate yourself is described here: http://www.chilipepperdesign.com/2011/02/15/reveal-fan-gate-like-gate-facebook-iframe-tab-tutorial-with-php
The like button:
<fb:like href="http://www.facebook.com/diesel" send="true" width="450"
show_faces="true"></fb:like>
Upvotes: 0