こんにちは、FB アプリから友達の壁に画像を投稿しようとしています。このコードはありますが、投稿に画像を添付する方法がわかりません。テキストのみの投稿です。誰も実例を持っていますか? またはどこにエラーがありますか?ありがとう。
ここに画像への完全なパス - 画像へのパスに置き換えます ここに MY FB アプリへの完全なパス - fb アプリへのパスに置き換えます。
FB.ui(
{
target_id: '100000505490012',
method: 'stream.publish',
message: 'Just Testing!!!.',
attachment: {
name: 'test name',
caption: 'Caption here.',
description: (
'description here'
),
href: 'http://facebook.com/mysite'
},
media: {
type: 'image',
src: 'FULL PATH TO IMAGE HERE',
href:'FULL PATH TO MY FB APP HERE'
},
action_links: [
{ text: 'Code', href: 'FULL PATH TO MY FB APP HERE' }
],
user_prompt_message: 'Personal message here'
},
function(response) {
if (response && response.post_id) {
alert('Post was published.');
} else {
alert('Post was not published.');
}
}
);