Customizing your Facebook iFrame Application – Reveal Tabs Fan-gating & Other Cool Stuff

If you’re NOT on the HyperArts Blog, CLICK HERE!

IMPORTANT: You have to upgrade your Fan Page to the new layout before the application below will work on your Fan Page. Many Pages will see a big banner at the top of their Page announcing the upgrade. If you don’t, you can click here to upgrade your Fan Page.

In our previous tutorial on Facebook iFrame tab applications, we looked at how to set custom iFrame tabs on your Facebook Fan Page.

In this tutorial, we will look at how you can use the information that Facebook passes to your iFrame application when it is loaded to customize the experience of the person viewing the tab. This includes presenting different content for fans vs. non-fans, aka the Reveal tab or Fan-gating.

NOTE: A basic understanding of PHP is required

This tutorial will require that you have at least a basic understanding of PHP. If you do not, you can certainly copy the code from this tutorial and use it, but it may be difficult for you to modify the code for your exact needs. We cannot provide support for PHP issues that you may experience since they are outside the scope of this blog.

There are lots of great resources about PHP on the Internet that can help get you up to speed. I have found the resources at Tizag to be useful as I learned PHP, so you might check them out.

Facebook’s new iFrame Page Tabs — the signed_request variable

When a Facebook user clicks on your “tab” in the left-column navigation, Facebook loads your page via an iFrame, which embeds your content into the Facebook page. While Facebook is loading your page, it POSTs some information about your page to your application index page.

The information that is POSTed is contained in an encoded variable called “signed_request”. When you decode the signed_request via PHP, the following information will be able to you:

  • The Page ID for the tab that is loading your application;
  • Whether the logged-in user has “liked” this Page;
  • Whether the logged-in user is an admin of the Page;
  • The country of the user;
  • The locale of the user.

Decoding signed_request data with Facebook’s PHP SDK

In this article we will be looking at how to handle the decoding of the signed_request data using the Facebook PHP Software Developer Kit (SDK) . If your server doesn’t support PHP, you may be able to accomplish something similar using the JavaScript SDK, but that is beyond the scope of this blog post.

Installing the Facebook PHP SDK

You can download the latest Facebook PHP SDK here.  Once you have downloaded the file, unzip it (if your OS didn’t already).  The file that we need is in the “src” directory and is called “facebook.php”.  We recommend that you put this file on your server in the same directory your index file resides.

Loading the Facebook PHP SDK in your index file

Next, you need to tell PHP to load the Facebook SDK file when your index file is loaded.

Open your index.php and add this PHP code:

<? require 'facebook.php';

Note: If you called your index file “index.html” based on our earlier iFrame Page Tab tutorial, you will need to change the name to “index.php” and also change the file name in your Facebook Application settings (Facebook Integration > Page Tabs > Tab URL).

Initializing the Facebook PHP SDK

Next, you will need to initialize the PHP SDK. To do this, insert some additional code into your PHP:

$app_id = "APP_ID_HERE";
$app_secret = "APP_SECRET_HERE";
$facebook = new Facebook(array(
'appId' => $app_id,
'secret' => $app_secret,
'cookie' => true
));

Note: You will need to replace the “app_id” and “app_secret” values with the ones for your application.  You can get these by going to facebook.com/developers.  Under “My Apps” on the right side of the screen, click on the name of your application. You will see the App ID and App Secret values as shown below.

Using the PHP SDK to decode the signed_request variable

We are finally ready to decode the signed_request variable that Facebook POSTs to your application.

$signed_request = $facebook->getSignedRequest();

We can now access specific values in the array like this:

$page_id = $signed_request["page"]["id"];
$page_admin = $signed_request["page"]["admin"];
$like_status = $signed_request["page"]["liked"];
$country = $signed_request["user"]["country"];
$locale = $signed_request["user"]["locale"];

You might want to add some “echo” code to display the values of each setting for troubleshooting:

echo "<br>page id = $page_id";
echo "<br>page admin = $page_admin";
echo "<br>like status = $like_status";
echo "<br>country = $country";
echo "<br>locale = $locale";

Using the signed_request variables to create the Reveal / Fan-gating feature

Now comes the fun part. The most common thing you might want to do is present different content to people who have “liked” your page vs. people who have not yet liked it.

You can use the variables in signed_request to check if the visitor has liked the Page on which your iFrame tab resides. You do this by testing the value of the variable “like_status”:

if ($like_status) {
echo "You like us";
}
else {
echo "You don't like us yet";
}

Create Page Tab content based on which Fan Page the app is installed

Another common use of these variables will likely be to customize an application based on which Fan Page it is installed on. This will allow you to use a single application on multiple Pages by tailoring the output to a specific Page.

You can test the Page ID like this:

if ($page_id == '12345') {
echo "content for 12344";
}
elseif ($page_id == '56789') {
echo "content for 56789";
}

You can do similar tests to customize the content based on country or locale or to display specific content only for Page Admins.

Can I access user data?

Facebook does not pass any personal information about the logged in user to your application unless they have specifically authorized your application.  If they have authorized your application, their User ID will be passed as part of the signed_request and you can access it in the same way that we accessed the other values above.  Creating the Request for Permissions dialog is beyond the scope of this tutorial, but we might cover that in a future tutorial if there is interest.  Once you have the user ID, you will be able to access whatever information the user gave you access to via the Graph API.

Download the code

We have created a ZIP file with the sample code from this tutorial as well as the latest version of the PHP SDK file (facebook.php). You can download it here.

Troubleshooting

We will update this section with iFrame app troubleshooting apps as the discussion continues in the comments.

Check your protocol (HTTP vs HTTPS)
There is a known issue where iFrame applications contained on Fan Page Tabs appear blank when accessed over SSL (via a URL that begins with https:// rather than http://). This normally happens when a FB user turns the setting at Account Settings > Account Security > Secure Browsing (https) on. It can also happen if you the user goes to https://facebook.com rater than http://facebook.com. The expected behavior is that users accessing the tab over https should see the page listed in the Secure Canvas URL in the Application Setup. The bug is that the page is just blank instead. You can read more, and vote for, the bug at http://bugs.developers.facebook.net/show_bug.cgi?id=15200

iFrame content not visible when you are not logged in to Facebook
There was a known Facebook bug that sometimes caused iFrame app tabs to appear blank when the visitor is not logged into Facebook.

Update: 3/1/11 Most reports seem to indicate that this bug is now resolved in production.

The Facebook SDK requires PHP 5
In order to use the PHP SDK (aka facebook.php), you will need to have PHP5 installed on your server. If you are not sure what version of PHP you have, put this in an empty index.php file:

<? phpinfo() ?>

Check your URL’s for www
Some servers are set to redirect “domainname.com” to “www.domainname.com”. If you server does this and you specify “domainname.com” in your Canvas URL in App Setup, the redirection will erase the signed_request parameter and all of your variables will be blank. To get around this, just include the “www” in the Canvas URL. See our previous tutorial for help on application setup.

Next Steps

This is just a hint of the powerful new things you will be able to do with iFrame apps on your Fan Page. We hope that you find this useful — we would love to hear about what topics you would like to see covered in future posts in this tutorial series. Just add a comment to the post to let us know!

Technorati Tags: , , , ,

  • http://www.redhotdesign.co.za Norman

    Hi, thanks for this- it was working and then suddenly stopped working. Is this a FB bug, is something happening behind the scenes with FB code?

    When accessing a ‘tab’ directly from the left-side menu, like/unlike triggers the expected changes. When a user lands on ‘tab’, (which is set as default landing area from page settings) a click on like always redirects to the wall instead of the ‘fan side’ or reveal content.

    • http://www.facebook.com/profile.php?id=748229904 James Loren

      Just to add to this… I have a client that is experiencing this same exact behavior on their Facebook page. I’ve created a “fan-gated” application for their page but  when they click the like button, the wall displays instead of the “reveal” page. I, on the other hand, am not experiencing this and I’ve tested in Firefox, IE, Google Chrome, Safari, and Opera on both Mac and PCs.

      Anyone have any ideas as to what might be causing this? Any solutions? Thanks in advance!

      • http://www.cheftomcooks.com Chef Tom

        I need help with this too!

      • http://www.cheftomcooks.com Chef Tom

        I need help with this too!

        • http://www.facebook.com/people/Ryan-Wheaton/1284416561 Ryan Wheaton

          Did anyone find the fix with the fan-gate tabs? I noticed this issue with the new Recommend box. It is taking me to the wall instead of my custom tab.

          Any info or updates would be greatly appreciated!

      • http://www.cheftomcooks.com Chef Tom

        I need help with this too!

    • http://www.facebook.com/profile.php?id=748229904 James Loren

      It turns out that this is indeed a Facebook bug and Hyper Arts has already reported it – God bless ‘em! Details are at: http://www.facebook.com/notes/hyperarts-web-design/facebook-like-button-redirects-user-to-wall-after-liking-bug/10150144146925844The next time I’m up in Oakland, I’m buying all of you guys a beer!

      • http://www.facebook.com/profile.php?id=748229904 James Loren

        Okay… So it looks like Facebook closed the Hyper Arts bug report but a new one has been opened for this issue:

        http://bugs.developers.facebook.net/show_bug.cgi?id=19778

        I highly recommend that you “vote this bug up” so that
        Facebook tends to it immediately. You’ll need to open a Bugzilla account at http://bugs.developers.facebook.net/createaccount.cgi
        and then go back to the bug report and click on the “vote” link.

        Be sure to spread the word too. This is a cool feature that needs to get fixed ASAP!

      • http://www.facebook.com/profile.php?id=748229904 James Loren

        Okay… So it looks like Facebook closed the Hyper Arts bug report but a new one has been opened for this issue:

        http://bugs.developers.facebook.net/show_bug.cgi?id=19778

        I highly recommend that you “vote this bug up” so that
        Facebook tends to it immediately. You’ll need to open a Bugzilla account at http://bugs.developers.facebook.net/createaccount.cgi
        and then go back to the bug report and click on the “vote” link.

        Be sure to spread the word too. This is a cool feature that needs to get fixed ASAP!

    • http://www.madsgormlarsen.dk Mads Gorm Larsen

      I have the same problem – did you find a solution?

  • Atanasovetr

    hi all, i need some unique info of user
    i need to extract some unique info for each user 
    i have proho contest site and a put into iframe in facebook so i need if uses has already voted to see “you have been voted” 
    thanks a lot and sorry for my english

  • eva

    I use this code “if ($like_status) {
    echo “You like us”;
    }
    else {
    echo “You don’t like us yet”;
    }”
    but it shows “You don’t like us yet” even when I like the page

  • http://www.facebook.com/people/Demonoid-Demo/100002568289545 Demonoid Demo

    hello, thank you for your wonderful tutorial. i have couple of questions. first the redirect after the user likes the pages. i created 2 pages one is index.php and the other revealed.php. so i used the code from your tutorial and 

    if ($like_status) {require(“index1.php”);}else {
    require(“index.php”);
    }
    rest of html here

    i used the above code in index.php. it works but the html from the index.php is “outputted” when the user likes the page + the html of the index1.php . this is how i prevent it 

    if ($like_status) {
    require(“index1.php”);
    }
    else {rest of html here}but i dont know if it is the best method.any suggestions?the other thing i noticed is that using the above method when i add links to other pages like . contact.html i can click them and navigate to them but when i hit f5 i go back to the index.php page.thanks

  • http://www.facebook.com/people/Demonoid-Demo/100002568289545 Demonoid Demo

    Hi again, i have another question, if you see the source of the facebook page you can find the url of the page in the hosted server . is there a way to avoid that?

    thank you again for your wonderful tutorials

  • http://www.facebook.com/people/Demonoid-Demo/100002568289545 Demonoid Demo

    Hi again, i have another question, if you see the source of the facebook page you can find the url of the page in the hosted server . is there a way to avoid that?

    thank you again for your wonderful tutorials

    • http://www.hyperarts.com/blog/ Tim Ware

      No way to avoid that that I know of.

  • M7d_mh

    Hi,
    i am very appreciate for your great tutorial.
    now i can authorize who like my page , how can i access to some thing like friend list ,  post on his/her wall , personal information ?
     
    Thanks for all

  • http://twitter.com/cheftom Thomas Andrew

    I created an app here:
    http://www.facebook.com/horizonspeakers?sk=app_114626255309335  it is on
    a facebook place page.  But now when I click LIKE… instead of
    Redirecting to my FAN ONLY content, it asks me if I want to recommend to
    my friends…. then it redirects to the wall.

    How can I correct this ?

  • http://pulse.yahoo.com/_ST7LDNHOW3GBW4MYLX2NQJ5ADQ aravind

    Hi.. Thanks for this awesome info.
    I have a small doubt, may be a stupid one. I have a html page hosted in my server that I am calling using a custom app i created at the left sidebar of FB. This is a stand alone page with JS buttons for navigation. Is it possible for me to show content under one button for non-fans and content under another button in the same page for fans. Can I show a gift card when someone likes my page.

    Please advice. Thanks in advance

    • http://www.hyperarts.com/blog/ Tim Ware

      If you read this tutorial, that’s what it’s about. I’m not clear on what you mean by “buttons”, but you can use the PHP code to show or hide content from fans and non-fans.

    • http://www.hyperarts.com/blog/ Tim Ware

      If you read this tutorial, that’s what it’s about. I’m not clear on what you mean by “buttons”, but you can use the PHP code to show or hide content from fans and non-fans.

  • http://pulse.yahoo.com/_ST7LDNHOW3GBW4MYLX2NQJ5ADQ aravind

    Hi.. Thanks for this awesome info.
    I have a small doubt, may be a stupid one. I have a html page hosted in my server that I am calling using a custom app i created at the left sidebar of FB. This is a stand alone page with JS buttons for navigation. Is it possible for me to show content under one button for non-fans and content under another button in the same page for fans. Can I show a gift card when someone likes my page.

    Please advice. Thanks in advance

  • http://www.hyperarts.com/blog/ Tim Ware

    There is a known bug where page admins can’t see their own iframe tab contents. I believe this is the bug: http://developers.facebook.com/bugs/278910582136262?browse=search_4e77745b3e6175601149549

    • kobe tamsut

      Thanks for your reply Tim, however I don’t think that’s the case, I’ve tested it with other users which are not page admin. same app code (besides the app id and secret) but different reaction… the facebook.php file caused an error, session start so I simply replaced the latest version of it with an older one and the error was removed – might be because of that? though the same version of the file is being used for the original app (hosted on the same server off-course)
      anyhow, i can really use some help on that…

  • Corey Potter

    I got this to work with the code

    if ($like_status) {

    echo “You like us”;

    }

    else {

    echo “You don’t like us yet”;

    }

    But instead of outputting text, I’d like to load another page in the current iframe, or redirect to another page.  How would I do this?  I’ve tried several methods and only found errors.

  • http://www.facebook.com/people/Patricia-Rios/100002739981166 Patricia Rios

    hey thanks so much! i would like to ask u to talk about how to create a horizontal navbar to our custom fb fan pages!!! thanksssss
    patricia.

  • http://www.facebook.com/people/Patricia-Rios/100002739981166 Patricia Rios

    hey thanks so much! i would like to ask u to talk about how to create a horizontal navbar to our custom fb fan pages!!! thanksssss
    patricia.

  • Anonymous

    Hi Kasper,

    I have not tested this code with the current PHP SDK, but it should work just fine.  Just include the facebook.php file — that file automatically includes the “base_facebook.php” file for you.

    Bill

  • Elli Vizcaino

    This article leaves me a bit confused. It isn’t clear whether what’s stated above will create a reveal tab that can then redirect users to different content once they’ve liked the page and if so, it isn’t clear as to implement that from the above examples. I also noticed there is another article on this site that uses JavaScript redirection, so I am left wondering if one has to implement both the above PHP as well as the JavaScript redirection? Or can one be used in place of another? And are two custom tabs required to create the “reveal” effect/redirection or can it also work with a webpage that offers additional links and have the redirection go to one of those links?

  • Pol Sol

    Thank you! That was very helpful!!! i wanted to ask why i can’t see my page as a facebook application it is. I only can see the index.php file from my server’s url, but not through the actual fb application url!
    Thanks again!

    • http://www.hyperarts.com/blog/ Tim Ware

      It sounds like you have your app configured incorrectly.

      If you can add the app tab to your page, then select the tab and right-click in the area where your content should be and select the “view this frame” to make sure your app is pulling in your index page.

  • Anonymous

    Oh… This post just craked me up. This is so mental!!! Facebook has to be the most stupid, anoing, retarded, website ever created. I’ve nver seen a more incoherent, complicated, messy website in my life.

    • http://www.hyperarts.com/blog/ Tim Ware

      Well then, my friend, you haven’t lived!

      Happy trolling….

      • jupiter swan

        Sorry, I just don’t see how my comment would be considered trolling as I wasn’t criticizing your article but Facebook’s terrible designing and coding, which provides a dreadful experience to anyone forced to deal with it. If you’ve found my comment to excessive, blame it on the frustration and exasperation caused by using FB.
        As for my spelling, please except my apologies but English is not my first language. The same probably happens to you when you write in a different language.
        Anyway, keep up the good work; we FB users need all the help we can get.

        • http://www.hyperarts.com/blog/ Tim Ware

          Thanks JS. First, your comment was fairly irrelevant to the subject of my blog post. And it was just complaining not supported by any examples.
          If you’ve not seen “a more incoherent, complicated, messy website” then you’ve not visited MySpace.
          I find Facebook to be quite well organized, actually, and not really all that complicated.
          Of course, if you find it complicated and incoherent then you can simply choose not to use it.
          But thanks for your opinion.

        • http://twitter.com/mehphil Terra Firma

          jupiter swan is not alone to get frustrated with facebook. Facebook’s own forums have grunts from experienced programmers in quite large numbers. If you say it is easy, maybe because you might have tried only simple things to integrate. For developers, there is only one downloadable code – in python. When python developers are in fraction to people developing in PHP, you can see futility of providing code attractive to only few.

          What they could have done (my humble opinion, you may attack it as I logically guessed from response to jupiter swan) :
          Provide an application using PHP-SDK which uses good number of capabilities of application which starts to work out of the box with just defining app id and app secret. People can expand it using it as a starting point. That will result in lot of time saving and frustration of missing out something they have mentioned elsewhere.

          People are looking for help that is how they land on your site. Your assumption they should come with all praise and with certain standard of minimum acceptable literacy is too much to ask. They may be blessed with other capabilities you might not have dreamt of developing in your lifetime.

          I have intentionally not capitalised ‘jupiter swan’ as it is our practice due to increased use of messages online. e.g. we do not generally write ‘you’ but ‘u’. I am not afraid my grammer, punctuation or skills of written communication will be critisized by somebody who starts to play boss to anyone visiting his page.

          Cheers.

        • http://www.hyperarts.com/blog/ Tim Ware

          Hello Terra Firma. Sounds like you’ve got it nailed, my friend!

  • Anonymous

    I am trying to show a few videos to my fans only.
    Are there best practices for revealing videos to fans?
    (i.e. where do I host the videos, what format, what player, etc).

    Any hint is appreciated.

    • http://www.hyperarts.com/blog/ Tim Ware

      Embed YouTube or Vimeo videos. No best practices for showing videos to fans as opposed to non-fans. Make sure they’re appropriate.

  • kostas krom

    i am searching for script which is 3 step. When they like my page then they should share it and then a link will appear.Can i do that?

    • http://www.hyperarts.com/blog/ Tim Ware

      If you’re talking about the quite tired, user unfriendly method of forcing the user to Share your page before they can continue, you can’t and you *shouldn’t* do this. It violates Facebook’s Terms of Service.

  • http://www.facebook.com/profile.php?id=1020584359 Steven Mrzodiac Reekmans

    Very nice tutorials, really well written and to the point.

    However I got the extra tab’s working and reading html pages correctly. I seem to have problems in the PHP area.

    I seem to get a “Restricted access” message on my fan page.

    What could be wrong here? I have php 5.2.5 running on my server.

  • http://www.facebook.com/profile.php?id=1020584359 Steven Mrzodiac Reekmans
    • http://www.hyperarts.com/blog/ Tim Ware

      It appears the problem is that you’ve provided a Secure URL for your Page tab app, but that URL doesn’t actually have an SSL security certificate. You can read my article on Facebook and HTTPS hosting.

    • http://www.hyperarts.com/blog/ Tim Ware

      It appears the problem is that you’ve provided a Secure URL for your Page tab app, but that URL doesn’t actually have an SSL security certificate. You can read my article on Facebook and HTTPS hosting.

  • http://www.hyperarts.com/blog/ Tim Ware

    Approved

  • http://www.facebook.com/people/Kyle-Suva/748412618 Kyle Suva

    For the life of me I cannot get this to work. It doesn’t seem to be getting any values from the getSignedRequest();

    Here is my code, I am putting the correct values in for the id and secret, I chose to omit them here:
    $app_id,
    ‘secret’ => $app_secret,
    ‘cookie’ => true
    ));

    $signed_request = $facebook->getSignedRequest();
    $like_status = $signed_request["page"]["liked"];
        
        ?>

    Untitled Document

       

    I am also using an updated version of facebook.php that requires a “base_facebook.php”, any thoughts?

  • Thomas Petersen

    Is it possible to do this without using PHP?

    • http://www.hyperarts.com/blog/ Tim Ware

      You has to be done with PHP. If you’re not a programmer, or don’t want to hire a programmer, you could use a free iFrame page-tab app like TabPress which handles all of the PHP for you.

  • http://www.facebook.com/kt178084 Kevin Townsend

    Thanks for the articles!  They’ve been really helpful!
    My problem is my nonfan and fan content are still not showing up.
     Here’s my code.  I created really basic html files to test the app.  My non fan is called nonfan.html and my fan is fans.html.  Let me know if you see anything wrong with my index.php file located below.  Thanks!
    $app_id,
    ‘secret’ => $app_secret,
    ‘cookie’ => true
    ));

    $signed_request = $facebook->getSignedRequest();

    $page_id = $signed_request["page"]["id"];
    $page_admin = $signed_request["page"]["admin"];
    $like_status = $signed_request["page"]["liked"];
    $country = $signed_request["user"]["country"];
    $locale = $signed_request["user"]["locale"];

    // If a fan is on your page
    if ($like_status) {
    $a = file_get_contents(“fans.html”);
    echo ($a);
    } else {
    // If a non-fan is on your page
    $a = file_get_contents(“nonfan.html”);
    echo ($a);
    }

    ?>

    • http://www.hyperarts.com/blog/ Tim Ware

      I’m not going to troubleshoot your code, Kevin. This tutorial is pretty clear on how to do it right.
      You should make sure your app index.php page is hosted on a secure server with an SSL certificate, under HTTPS, and that you’ve specified the Secure URL in the app settings. See this tutorial for more info on that.

      • http://www.facebook.com/profile.php?id=510314914 Kwasi Brown

        please update the tutorial and let everyone know that all files in the src folders should be in the uploaded to their server as well.

    • http://www.facebook.com/profile.php?id=510314914 Kwasi Brown

      You need to upload all the filed in the src sdk folder in order for to work! I had the same problem and it took me 5 mins to figure it out.

  • http://www.facebook.com/MattQ90 Matthijs van Drunen

    Make sure to check whether your server supports JSON (you need php 5.2 for that). When downloading the latest version of the Facebook PHP SDK you’ll find a few extra files in the zip, these cannot be processed with an older version of php. 

  • http://www.hyperarts.com/blog/ Tim Ware

    One way to get your fan page’s ID is to click on the profile image in the top left corner.
    In your browser’s address bar, you’ll see a URL similar to this (HyperArts example): https://www.facebook.com/media/set/?set=a.10150107028147468.321340.75033592467&type=1
    In that string, the numbers between the last “.” (period) and the ampersand is the page ID.
    So in this example, the page ID is: 75033592467

    Should work.

  • Anonymous

    i wrote a php fangating program using php sdk, it works fine if the user
    is https enabled, but if the user is http enabled, it is not working,
    how to make fangate work even if the user is http enabled ?

    • http://www.hyperarts.com/blog/ Tim Ware

      You’ll need to troubleshoot your own code, I’m afraid. Ours works fine under http or https, as long as the index page of the tab is hosted on a secure server with an SSL certificate.

  • http://www.facebook.com/people/Andy-Webb/1114615109 Andy Webb

    Sorry if this seems a simple question, how do I get the app to appear on the page for visitors to see? I have built the basic app which is fine; and I have hosted with Heroku (I can manage GIT okay)…

    http://apps.facebook.com/awebb-new-lookBut I cant seem to associate this with my test business as a tab…https://www.facebook.com/pages/Awebbdesign/182225708540282I cant seem to add the app to Awebbdesign, any help would be much appreciated.

  • sangeetha bhatta

    Thank you for this tutorial. I want to make an app just for my use. And am new to Facebook totally. I followed your instructions. But all the variable values are printed blank, as below.
    page id = page admin = like status = country = locale = You don’t like us yet

    Can you please help?

    • http://www.hyperarts.com/blog/ Tim Ware

      Sorry, Sangeetha, we don’t do in depth troubleshooting of code here. Sounds like something is definitely configured wrong.

      • sangeetha bhatta

        Found the bug :) . While setting up the app, I mentioned base url without the file name as you have pointed out in your tutorial. Facebook also says to give the base url. But after 2 days of head-banging, I tried full url and it worked !!

        • http://www.hyperarts.com/blog/ Tim Ware

          That’s great, Sangeetha. And thanks so much for sharing your experience here, so that others can benefit from your discovery. I wish more folks who show up and ask questions would follow up with how they resolved things.

  • http://www.hyperarts.com/blog/ Tim Ware

    Holly, If you’re using the exact same PHP code and it’s not working, I can’t really help. Sorry! Sometimes it can just be a Facebook bug.
    You might doublecheck all your app settings on the Developer Page. Facebook has been introducing some new options and parameters, so I’d doublecheck those.

  • http://www.hyperarts.com/blog/ Tim Ware

    I can’t really help, Holly. Sorry!

  • http://www.facebook.com/josephwraith Joseph Wraith

    The headline reads:
    “Customizing your Facebook iFrame Application – Reveal Tabs Fan-gating & Other Cool Stuff”
    But I’m not seeing how to create a Fan-Gate on here at all.
    Did I miss something? Does the php I use from this allow me to create such a gate? I am very new to php so forgive me if I missed it in your lesson here.

    • http://www.hyperarts.com/blog/ Tim Ware

      See the section “Using the signed_request variables to create the Reveal / Fan-gating feature”.

    • http://www.facebook.com/josephwraith Joseph Wraith

       I saw it, but don’t really get it, I think php is a still a bit mystifying for me. So I think I need a simpler approach to understanding what you are trying to convey and what  I am trying to do.

  • Ian Simmons

    Just read your other article and made my first test app as a welcome tab. Now this part was a piece of cake!  I combined the ‘like’ check and ‘page id’ check into one if statement so if the user likes and the page id is correct they see fan content, else, they see the non fan content.  I’m guessing what you mean by different page id’s is for if you have more than one app? That part is confusing because I get the same page id whether the user likes or not. Can you explain that part further and in what case I would have multiple page id’s?

    Thanks 

    • http://www.hyperarts.com/blog/ Tim Ware

      Correct!

  • http://www.hyperarts.com/blog/ Tim Ware

    It sounds like an error in your PHP, Ian.