2011-12-14 87 views
1

我有iframe Facebook应用程序,但重新加载使无限循环。我的Facebook应用程序使无限循环在SDK 3.1.1

昨天工作正常,但不是一天。

我使用的JavaScript和PHP SDK 3.1.1与此代码:

<div id="fb-root"></div> 
<script src="http://connect.facebook.net/en_US/all.js"></script> 
<script> 
    FB.init({ 
    oauth: true, // turn oauth 
    appId : 'myappId', 
    status : true, // check login status 
    cookie : true, // enable cookies to allow the server to access the session 
    xfbml : true // parse XFBML 
    }); 
FB.Canvas.setAutoGrow(); 
</script> 

FB.getLoginStatus(function(response) { 
     if (response.session) { 
     var query = FB.Data.query('select publish_stream from permissions where uid={0}', response.authResponse.userID); 
........................ 
     } 
} 

如果我删除"<script src="http://connect.facebook.net/en_US/all.js"></script>"线,它没有无限循环,但应用程序无法正常工作像我想要的。

+0

当你删除Facebook连接参考什么是不工作?你表示你处在一个无限循环的地方?这表明你有问题,但是你的问题没有得到足够的具体解答,无法获得帮助。 – ahsteele 2011-12-15 06:30:06

回答

1

的Facebook迁移的JavaScript SDK支持的OAuth2,并requiere所有的应用程序必须在2011年10月1日,迁移到OAuth 2.0(但最后一次是2011年12月14日),因此,我改变:

FB.getLoginStatus(function(response) { 
     if (response.session) { 
........................ 
     } 

通过

FB.getLoginStatus(function(response) { 
     if (response.authResponse) { 
........................ 
     } 

因为应用程序已启用OAuth 2.0进行初始化。

案件结案。

相关问题