我使用 RestFb 作为 Java 包装器来调用 Facebook 图形 API。我想以管理员身份发布到我的粉丝页面。目前,所有帖子都显示为我的个人帖子。我已使用“manage_pages”作为权限之一获取 access_code。这是我的代码:
public void postOnWall(String wallId, String message, String picture, String link, String linkname, String caption, String description) throws FacebookException {
facebookClient.publish(wallId+"/feed", FacebookType.class,
Parameter.with( "message", message),
Parameter.with( "picture", picture),
Parameter.with( "link", link),
Parameter.with( "name", linkname),
Parameter.with( "caption", caption),
Parameter.with( "description", description));
}
在我的调用方法中:
try {
FacebookService facebookService = new FacebookService("access_token");
facebookService.postOnWall("page_id", comment, "image", "link", title, "caption", description);
} catch (FacebookException e1) {
e1.printStackTrace();
}
我已将双引号中的所有参数替换为实际值。还需要什么?