我有通過JavaScript SDK發佈對話框的問題。它有時工作,有時不。Iframe應用程序JavaScript SDK發佈對話框錯誤(代碼102)
它拋出這個錯誤:
API Error Code: 102 API Error Description: Session key invalid or no longer valid Error Message: Iframe dialogs must be called with a session key
我的代碼:
<script>
window.fbAsyncInit = function() {
FB.init({
appId : 'CENSORED', // App ID
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
// wait a moment before showing dialog.
setTimeout("showbox()", 2 * 1000);
};
// Load the SDK Asynchronously
(function(d){
var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
d.getElementsByTagName('head')[0].appendChild(js);
}(document));
</script>
and
<script>
function showbox()
{
FB.ui(
{
display: 'iframe',
method: 'feed',
name: 'ASD ASD ASD:',
link: 'https://apps.facebook.com/XXX/',
picture: 'https://skvelazabava.eu/XXX/yy.jpg',
caption: 'Největší alkoholici mezi tvými přáteli jsou:',
description: ' ',
properties: [{text:"XXX", href:"https://apps.facebook.com/XXX/"},
{text:"YYY", href:"https://apps.facebook.com/XXX/"} ],
redirect_uri: 'https://url.eu/'
});
}
</script>
我有什麼做的,以確保對話將有會話密鑰。