我正在使用 Javascript,我的应用程序正在使用 FB.ui 和 FB.api 发布到 Facebook 最近,我收到一封包含以下内容的邮件:
看起来您的应用 (...) 可能正在发布带有预填充标题的照片。如果是这种情况,您需要在接下来的几天内删除所有默认照片标题,以避免受到限制。
提醒一下,Facebook 平台政策不允许这样做,因为我们希望应用发布的故事能够代表用户的声音。您可以在以下网址阅读有关此政策的更多信息: https ://developers.facebook.com/policy/#integration
我使用的功能如下,现在经过这么多测试,我真的不明白哪个功能是问题所在。我怀疑该功能upload_foto
可能是问题,但我不确定,如果我无法使用 javascript FB.api 上传照片,那我该怎么做?知道如何解决这个问题吗?
function postToWall(to_user_id, title1, url_to_picture, link_to_open) {
var control = document.getElementById("my_silverlight");
//this will publish a story to the specified user or page (post owner is the user not the page)
FB.ui({ method: 'feed',
name: title1,
display: 'iframe',
link: link_to_open,
description: 'Some description',
caption: 'Some caption',
picture: url_to_picture,
type: 'photo',
to: to_user_id
}, function (response) {
if (response && response.post_id) {
control.content.PageName.update_post("success");
} else {
control.content.PageName.update_post("error");
}
});
}
function postToPage(to_user_id, title1, url_to_picture, link_to_open) {
var control = document.getElementById("my_silverlight");
//this will publish a story to page if the user is the page's administrator (post owner will be the page itself)
FB.ui({
method: 'feed',
name: title1,
display: 'iframe',
link: link_to_open,
description: 'Some description',
caption: 'Some caption',
picture: url_to_picture,
type: 'photo',
to: to_user_id,
from: to_user_id
}, function (response) {
if (response && !response.error) {
control.content.PageName.update_post("success");
} else {
control.content.PageName.update_post("error");
}
});
}
function postToGroup_Event(to_profile_id, title1, mes, url_to_picture, link_to_open) {
var control = document.getElementById("my_silverlight");
//this will publish a story to a group or an event as the curent user
FB.api("/" + to_profile_id + "/feed", 'post', { name: title1, link: link_to_open, description: 'Some description', caption: 'Some caption', picture: url_to_picture, message: mes }, function (response) {
if (response && !response.error) {
control.content.PageName.update_post("success");
} else {
control.content.PageName.update_post("error");
}
});
}
function upload_foto(from, to_profile_id, url_to_foto, mess, own_wall) {
var control = document.getElementById("my_silverlight");
//this will publish a foto with a message to a profile
FB.api(to_profile_id + '?fields=access_token', function (response) {
if (response && !response.error) {
FB.api(to_profile_id + '/photos', 'post', { from: from, url: url_to_foto, message: mess, access_token: response.access_token }, function (response) {
if (response && !response.error) {
control.content.PageName.update_post("success", response.post_id);
} else {
control.content.PageName.update_post("error", "");
}
});
} else {
control.content.PageName.update_post("error", "");
}
}, { scope: '' });
}