我正在使用这个标准的facebook授权码,但它没有显示已批准该应用程序的用户数量。它仍然是0,我知道有几个人已经批准了这个应用程序。是不是我的代码里有什么东西?
$app_id = YOUR_APP_ID;
$canvas_page = YOUR_CANVAS_PAGE_URL;
$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 {
echo ("Welcome User: " . $data["user_id"]);
} 发布于 2011-01-29 06:01:20
您是否用有效的YOUR_APP_ID & YOUR_CANVAS_ID替换了它们,或者在某个地方声明了它们?
这会返回什么?
print_r($signed_request);您是否会被重定向到登录页面?
https://stackoverflow.com/questions/4820957
复制相似问题