ユーザーの画像を収集し、Facebookにアップロードするために使用したい標準のファイルアップロードフォームがあります。
アップロード フォームをFB 'ステージング' urlに投稿すると、エンコードされたステージング参照が取得されますが、フィード ダイアログを起動しようとするとFB.UI()
、ステージング トークンを「画像」パラメーターとして指定すると失敗しますか?
ステージング URL は、ダイアログを使用せずにグラフ オブジェクトを作成するためだけのものですか? ダイアログを使用したい場合は、画像を別の場所にアップロードして参照する必要がありますか?
これが私の例です:
$('#picture_upload').submit(function(e){
e.preventDefault();
$(this).attr('action',$(this).attr('action')+'?access_token='+accessToken);
$(this).ajaxSubmit({
success: function(response){
FB.ui(
{
method: 'feed',
name: 'Facebook Dialogs',
picture: response.uri,
caption: 'Reference Documentation',
description: 'Dialogs provide a simple, consistent interface for applications to interface with users.'
},
function(response) {
if (response && response.post_id) {
alert('Post was published.');
} else {
alert('Post was not published.');
}
}
);
} //call function after success
});
});
応答には次のようなものが含まれます。
{"uri":"fbstaging://graph.facebook.com/staging_resources/MDAxMDE1MTU3NjIyNzExNzYwNA=="}
関数のpicture
パラメーターとして明らかに無効なのはどれですかFB.UI