我试图从我的应用程序中将图像张贴在我的墙上。我希望图像可以看到它的原始大小,而不是像一张小图片。
我尝试了两种方法来做到这一点,但它不起作用。
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);
}
});
但图像没有显示在我的墙上。它在我的相册中,但我需要点击“批准照片”。单击后,它会显示在我的墙上。
我的问题是:如果我使用第一个代码,有没有办法以原始大小显示图像?
如果我使用第二个代码,如何让它从我的相册自动发布到我的墙上?