I've placed in the SDK properly into my CI setup, and I run a bit of code like this:
if (!empty($_POST['signed_request'])) {
$signed_request = $_POST['signed_request'];
}
list($sig, $payload) = explode('.', $signed_request, 2);
$data = json_decode(base64_decode(strtr($payload, '-_', '+/')), true);
var_dump ($data);
I'm only receiving back some of the information from this code, as follows:
array(6) { ["algorithm"]=> string(11) "HMAC-SHA256" ["expires"]=> int(1358985600) ["issued_at"]=> int(1358978635) ["oauth_token"]=> string(116) "AAACPRZBPSwx0BADKZBGikSA09ZCJeWDcOZCWYpg0YoXZAgSkZB6tnBQftKZAM3LFG9itoAwoYQ3bDeZCuyZBoPXvxqMTrAonrIphlQY4g0KPChwZDZD" ["user"]=> array(3) { ["country"]=> string(2) "us" ["locale"]=> string(5) "en_US" ["age"]=> array(1) { ["min"]=> int(21) } } ["user_id"]=> string(9) "---------" }
(Blocking out my user_id for obvious reasons!)
I'm told with the countless tutorials online that I should be able to use this code to determine if the app is "liked" or not:
if ($data["page"]["liked"]) { echo "yes"; } else { echo "no"; }
Am I missing something here?