2011-12-14 63 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進行初始化。

案件結案。

相關問題