1

我尝试了一些解决方案,但我似乎无法检索我传递给我的 facebook 标签页的“app_data”。

更新---------------- 对于我的标签页,我正在使用以下内容,但它不起作用:

// Connect to Facebook
$facebook = new Facebook(array(
        'appId'  => $FB_APP_ID, 
        'secret' => $FB_APP_SECRET
));
$signed_request = $facebook->getSignedRequest();
echo ($signed_request["app_data"]);//Nothing is output here!
4

2 回答 2

1

app_datasigned_request页面标签应用程序中,

对于常规画布应用程序,值应该是可用的$_REQUEST['app_data']

于 2013-03-08T20:00:58.457 回答
0
$facebook = new Facebook(array(
    'appId' => '$testapp_id',
    'secret' => '$testapp_skey',
    '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"];    
$fanpagid =$page_id;    

try {
$page_info  = $facebook->api("/".$page_id."?fields=link");
}catch(Exception $o) {
}

$fanpage=$page_info["link"];
$fullpageurl=$fanpage."?sk=app_".$app_id;

试试这个代码......

于 2013-03-12T11:09:22.833 回答