我尝试了一些解决方案,而且我似乎无法检索到传递到我的Facebook标签页的“app_data”。
UPDATE ---------------- 对于我的标签页,我使用以下内容并且无效:
// 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!
答案 0 :(得分:1)
app_data
中的 signed_request
用于页面标签应用,
对于常规画布应用程序,值应仅为$_REQUEST['app_data']
答案 1 :(得分: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;
尝试使用此代码......