[英]JavaScript: How to like a Facebook wall post (given a Facebook page URL and a Facebook post id) using API Graph?
[英]How to post to the wall like the admin of a page using the Facebook JavaScript SDK?
我有一個JavaScript函數,該函數用於將某些內容發布到當前用戶的牆上。 但是,當我進入由我管理的Page(Fanpage)時,它是:
function postToWall(id, title, desc, href, image, caption)
{
FB.ui(
{
method: 'feed',
app_id: social_app_id,
name: title,
link: href+'?ref='+social_user_id,
picture: image,
caption: caption,
description: desc
},
function(response) {
// nothing to do here
}
);
}
但是我得到了錯誤:
我的應用名稱發生錯誤。 請稍后再試。
如何張貼到管理牆以包括圖塊,說明,圖像和標題?
您應該為Feed Dialog
指定from
和to
參數。
FB.ui({
method: 'feed',
name: title,
link: href,
picture: image,
caption: caption,
description: desc,
from: 'ID_OF_PAGE_ADMIN_OR_PAGE',
to: 'ID_OF_PAGE'
}, function(response) {
// nothing to do here
});
如果from
和to
是相同的id to
則可以跳過,因為它的默認值為from
值。
更新 :
您可以使用Facebook頁面的ID來回填寫from
也to
頁面本身的形式發布,而不僅僅是頁面的Admin。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.