私はjavascriptsdkを使用してストリームへの公開ダイアログボックスの作成に取り組んでいます。動作させることができなかったので、欲求不満でアプリIDを以前に作業した別のアプリのアプリIDに置き換えてみました。どういうわけかこれは完璧に機能しました!コードに違いはなく、アプリIDのみが変更されます。
これがコードです。SDKが一方のIDで機能し、もう一方のIDでは機能しない2つのアプリ設定の違いは何でしょうか?実際、私が作成した新しいFacebookアプリケーションはjavascriptsdkで動作しません。私のオリジナルアプリのみ。
<div id="fb-root"></div>
<script>
(function() {
var e = document.createElement('script'); e.async = true;
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);
}());
window.fbAsyncInit = function()
{
FB.init({ appId: '696969696969', status: true, cookie: true, channelUrl: 'http://example.com/channel.html' });
FB.getLoginStatus(function(response)
{
console.log(response.session);
});
var publish = {
method : 'stream.publish',
message : '',
attachment : {
name : 'name',
caption : 'caption',
description : 'description',
href : 'http://www.fjdjdj.com'
},
action_links : [ { text : 'action link', href : 'http://www.cnn.com' } ],
user_message_prompt : 'user prompt'
};
FB.ui(publish, function(response) { console.log(response); });
};
</script>