0

Hi i have created new iFrame APP.

this is code part:

<fb:visible-to-connection>Welcome, fans!<fb:else>Become fan</fb:else></fb:visible-to-connection>

<script src="http://connect.facebook.net/en_US/all.js"></script>

Can anyone help me out??

I also tried doing this with newest Facebook PHP SDK. Unfortunately i can check it first i user accepted the APP, which is not the point in this case.

bkaid
  • 51,465
  • 22
  • 112
  • 128
  • possible duplicate of [Seamless way to check if user likes page](http://facebook.stackoverflow.com/questions/5329818/seamless-way-to-check-if-user-likes-page) – ifaour Sep 22 '11 at 21:41
  • fb:visible-to-connection was for fbml pages and is not supported by iframe pages. – bkaid Sep 23 '11 at 04:14

1 Answers1

0

I am almost sure that is not working anymore.

To detect a like or non-liker you can use the signed request to get that data. It gets passed to a tab when it is loaded.

<?php
$signed_request = $_REQUEST["signed_request"];

list($encoded_sig, $payload) = explode('.', $signed_request, 2);
$data = json_decode(base64_decode(strtr($payload, '-_', '+/')), true);
?>

Then in the body of your HTML:

<?php
    if ($data["page"]["liked"]!=1) {
        echo('<div id="NON_LIKER_CONTENT"> <img src="nonliker.jpg" width="520"/></div>');
    }  else {
        echo('<div id="LIKER_CONTENT"> <img src="liker.jpg" width="520"/></div>');
    }
 ?>
Juan Bermudez
  • 461
  • 2
  • 8
  • unfortunately signed_request isn't loaded in my tab... signed_request for Canvas is active under settings tab... any other idea ? – Oskar Hasinski Sep 23 '11 at 09:17