Facebook signed request not providing all information

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?


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

Apps can not be “liked”.

What can be liked, is a Facebook page, and if your ap is embedded into that page as a page tab, then you will get according info in the signed_request that gets posted to your app on the iframe's initial load.

链接地址: http://www.djcxy.com/p/54112.html

上一篇: Facebook:永久页面访问令牌?

下一篇: Facebook签署的请求不提供所有信息