自动检测facebook会话在FB连接网站



一个简单的问题是,我想当用户登录到Facebook,所以用户自动
登录我的网站。我已经在我的网站实现了FBconnect .no刷新页面…

    FB.getLoginStatus(function(response) {
    if (response.session) {
         //what to do here???
          //i dont want to use setTimeout() in this function to check it again & again
    }
   });

你知道怎么做吗?

看来你需要…

FB.Event.subscribe('auth.login', function(response) {
  // do something with response
});
https://developers.facebook.com/docs/reference/javascript/FB.getLoginStatus/

最新更新