0

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?

4

1 回答 1

0

网上无数的教程告诉我,我应该能够使用此代码来确定应用程序是否“喜欢”

应用程序不能被“点赞”。

可以喜欢的是 Facebook 页面,如果您的应用程序作为页面选项卡嵌入到该页面中,那么您将在签署的请求中获得相应的信息,该信息在 iframe 的初始加载时发布到您的应用程序。

于 2013-01-24T08:48:33.473 回答