0
最近私はウェブホストを変更しました。それ以来、私はFacebookのユーザーIDのために0を得ています:FacebookのユーザーIDは常に0です
<?php
$app_id = "xxxxxxxx";
$canvas_page = "http://apps.facebook.com/the_rsg/";
$auth_url = "http://www.facebook.com/dialog/oauth?client_id=".$app_id."&redirect_uri=".urlencode($canvas_page);
$signed_request = $_REQUEST["signed_request"];
list($encoded_sig, $payload) = explode('.', $signed_request, 2);
$data = json_decode(base64_decode(strtr($payload, '-_', '+/')), true);
if (empty($data["user_id"])) {
echo("<script> top.location.href='".$auth_url."'</script>");
}else{
$pageContent = file_get_contents('http://graph.facebook.com/'.$data["user_id"]);
$parsedJson = json_decode($pageContent);
$user_id = $parsedJson->id;
$user_name = $parsedJson->name;
session_start();
$_SESSION['UserID'] = $user_id;
}
?>
どのようにこれを修正できますか?エラーログを確認するには
あなたのFacebookアプリの基本設定が正しく変更されましたか? –
いいえ、キャンバスのURLを変更しました –
残りのデータは正しく返されますか? – JohnP