1

您好,我遇到了与https://. 我FB.getLoginStatus(function(response)在我的代码中使用了函数。它仅适用于http://但不适用于https://. 我用谷歌搜索并找到了使用FB._https = (window.location.protocol == "https:");. 几天前它工作得很好,但现在已经停止工作。

我的代码看起来像

 <script>
        FB._https = (window.location.protocol == "https:");
        FB.init({
            appId : '<?php echo $this->appId; ?>',
            status : true, // check login status
            cookie : true, // enable cookies to allow the server to access the session
            xfbml : true // parse XFBML
        });

     function PostAction(custom_action)
     {
        console.log('out side of getlogin status');
        FB.getLoginStatus(function(response)
        {
          console.log("in getlogin status");
          if (response.authResponse) {
             fbcallBack(response);
          } else {
             FB.login(fbcallBack, {scope:'publish_stream'});
        }
      });
   }
</script>

PostAction()在 onclick 事件中被调用。我已经写console.log()了调试代码。使用 facebook 时会触发控制台,out side of reglogin status但不会触发. 但如果我使用它效果很好。in getlogin statushttpshttp://

任何机构都可以指导我这是什么问题?如何解决?

问候。

4

1 回答 1

4

截至昨天 22:00,Facebook 发布了此公告:

http://developers.facebook.com/blog/post/2012/06/20/platform-updates--operation-developer-love/

正如 5 月宣布的那样,我们更新了 Javascript SDK 以限制公开暴露的接口。这是提高 SDK 可靠性的持续过程的一部分。我们删除了对所有内部属性和以 _ 为前缀的方法的访问权限。

如果您当前依赖于访问内部属性,请重构它,以便您仅依赖于 https://developers.facebook.com/docs/reference/javascript/中列出的公开可用(和官方支持)的方法。

请注意,所有未作为公共 API 的一部分列出的方法都可能会更改或删除,您不应直接使用它们。

于 2012-06-21T12:10:42.587 回答