开发者

facebook app not redirecting when aurizing

When I first authorize a user it goes and stays on the Canvas URL(my site) instead of redirecting back to the Canvas Page on facebook.How can I make sure once the user authorizes they go to the Canvas Page?

$(function() {
  FB.init({ appId: 'myappid', status: tru开发者_C百科e, cookie: true, xfbml: true, oauth: true });

  FB.getLoginStatus(function(response){
    if(!response.authResponse){
      top.location.href="http://www.facebook.com/dialog/oauth?client_id=myid&redirect_uri=http://mysite/myapp"
      }else{
        FB.api('/me',function(response){
        uname = response.name;
        userid = response.id;
        $.post("signin.php", { name:uname,id:userid},
              function(data) {


              });
           });
       }
   });
});


In your code, change the redirect_uri value from: http://mysite/myapp to: http://apps.facebook.com/appnamespace

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜