开发者

Facebook Won't Count App Users

I'm using this standard facebook authorization code but it's not showing the count of users who've approved the app. It's still at 0 and I know several people have approved the app. Is it something in my code or what?

 $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"];

 li开发者_如何学编程st($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"]);
 } 


Have you replaced those YOUR_APP_ID & YOUR_CANVAS_ID with valid ones or declared them somewhere?

What does this return?

 print_r($signed_request);

Are you getting redirected to the login page or not?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜