アプリケーションからウォールに画像を投稿しようとしました。画像は小さな写真ではなく、元のサイズで表示されるようにしてください。
私はそれを行うために2つの方法を試しましたが、うまくいきません。
FB.ui(
{
target_id:'ID',
method: 'stream.publish',
access_token:accessToken,
attachment: {
name: 'test name',
caption: 'Caption here.',
description: 'description here',
href: 'http://facebook.com/mysite',
media: [{'type': 'image', 'src': pic, width: '150', height: '120', 'href': 'MY_SITE'}]
},
message: '',
},
function(response) {
if (response && response.post_id) {
alert('Post was published.');
} else {
console.log(response);
alert('Post was not published.');
}
}
);
これは私の壁に画像を投稿しますが、それは小さな写真です。次のように画像をアルバムに投稿しようとしました:
FB.api('me/photos', 'post',
{
url:'MY_URL',
href:'MY_LINK,
message: 'photo description',
access_token:accessToken
},
function(response) {
console.log(response);
if (!response || response.error) {
alert('Error occurred');
} else {
alert('Post ID: ' + response.id);
}
});
しかし、私の壁には画像が表示されませんでした。それは私のアルバムにありますが、「写真を承認する」をクリックする必要があります。クリックした直後に、それは私の壁に表示されます。
私の質問は: 最初のコードを使用した場合、画像を元のサイズで表示する方法はありますか?
2 番目のコードを使用する場合、アルバムからウォールに自動的に公開するにはどうすればよいですか?