1

我正在将 fbAsyncInit 方法用于位于粉丝页面选项卡中的 iframe 应用程序

<script>
  window.fbAsyncInit = function() {
      console.log('fb init');
    FB.init({
      appId  : 12345,
      status : true, // check login status
      cookie : true, // enable cookies to allow the server to access the session
      xfbml  : true  // parse XFBML
    });
  };

  (function() {
    var e = document.createElement('script');
    e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
    e.async = true;
    document.getElementById('fb-root').appendChild(e);
  }());
</script>

当我调用注册函数来检查权限时(当用户在页面加载后单击按钮时会发生这种情况)

register = function(){
console.log('starting login');
FB.login(function(response) {
    if (response.session) {
            console.log(response.session);
        } else {                
            console.log('Did not authorize');
        }
}, {perms:'email,publish_stream'});

};

Facebook 从以下位置加载弹出窗口:http ://static.ak.fbcdn.net/connect/xd_proxy.php?version=3#cb= {此处的会话字符串变量和其他垃圾}

仅在 IE 中产生 flash 错误:

Error #2044: Unhandled StatusEvent:. level=error, code=

我的网站没有闪存

点击继续/关闭有时可能会冻结 IE 导致我结束进程,有时弹出窗口消失

4

3 回答 3

1

我们找到了 Flash 问题的解决方案。请更新FB.init

FB.init({
      appId  : 12345,
      status : true, // check login status
      cookie : true, // enable cookies to allow the server to access the session
      xfbml  : true,  // parse XFBML
      channelURL : 'http://www.YOURDOMAIN.com/channel.html'
    });

在您的域根文件夹中创建channel.html并仅将以下代码放入其中:

<script src="https://connect.facebook.net/en_US/all.js"></script>

现在 Facebook 上的 Flash 可以正常工作了。

于 2011-06-16T08:30:16.017 回答
0

Flash 10.2+ 使用 Flash/FaceBook API 时会出现以下错误。SecurityError:错误 #2000:没有活动的安全上下文。

Flash 10.3 你得到错误#2044:未处理的状态事件:。级别=错误,代码=

我正在从 Flash 应用程序调用 Facebook.login()。登录成功,但是此错误似乎中断了该过程。此问题仅影响 IE 8,不影响其他浏览器。我已经尝试了 channelUrl,但在另一个域中,因为我无权访问提供 Flash 文件的位置。我正在使用查尔斯来映射本地。这行得通吗?

除此之外,我迷路了。我不确定错误是由我的 SWF 还是 Facebook 的代理 SWF 触发的。太令人沮丧了。这是几个月前的工作。

于 2011-06-20T20:34:13.797 回答
0

上面提供的解决方案对我不起作用。但这确实是我在 stackoverflow 的另一个主题上发现的(感谢 Sean Kinsey):

请参阅此错误报告: http ://bugs.developers.facebook.net/show_bug.cgi?id= 15596 IE8,使用 flash XD 时 getLoginStatus 永远不会完成 - 听起来可能是您正在经历的。

在这种情况下,请确保您的fb-root div未设置为visibility:hiddendisplay:none ,因为这将导致 XD Flash无法呈现

(我也添加了 channelURL)

于 2011-11-16T03:40:51.877 回答