feed_PublishTemplatizedAction()返回true,但未在我的FansPage上发布

时间:2012-08-13 10:32:49

标签: facebook

我需要向我的FansPage发布供稿条目。为此,我使用了以下代码,

userClient = new FacebookXmlRestClient(api_key, secret);
if(userClient.users_hasAppPermission(Permission.OFFLINE_ACCESS, longFacebookUserID)){
    TemplatizedAction action = new TemplatizedAction("{actor} recommends {book}");                     
    action.setPageActorId(ctProfileId);//fansPageId
    action.addTitleParam("book", "<a href='http://www.amazon.com/Hamlet/dp/0140714545/'>Hamlet</a>");   
    action.setBodyTemplate("{actor} is using BooksApp!");                                               
    action.setBodyGeneral("100 other people recommend this book!");                                     
    action.addPicture("http://code.google.com/hosting/images/code_sm.png", "http://www.google.com"); 
    userClient.feed_PublishTemplatizedAction(action);}

当我执行此代码时,feed_PublishTemplatizedAction()返回true但未在我的FansPage上发布。

任何人都可以给我指导。

谢谢, 杰里。

1 个答案:

答案 0 :(得分:0)

供稿模板已弃用,不再有效。您应该阅读Feeds / Stream发布。此外,您应该远离REST API并使用Graph API。你的app和代码大概过时了。

您可以使用'/ me / feed'API调用发布到用户墙。