Post to Facebook Page Wall using RestFB api

I am trying to post facebook page on the wall. I can publish on the user’s wall using the application access token.

I got an application access token through the DefaultFacebookClient extension

public class ConnectionService extends DefaultFacebookClient{

public ConnectionService(String appId, String appSecret) {
    AccessToken accessToken = this.obtainAppAccessToken(appId, appSecret);
    this.accessToken = accessToken.getAccessToken();
}
}

With this, I can post to the user’s wall using appID and appSecret. But when I tried to post to the wall I get the error message "The user did not allow the application to perform this action"

Can anyone consult?

+4
source share
4 answers

facebook, :

final FacebookClient fb = new DefaultFacebookClient(PAGE_ACCESS_TOKEN); final Page page = facebookClient.fetchObject(PAGE_NAME, Page.class); facebookClient.publish("PAGE_NAME/feed", FacebookType.class, Parameter.with("message", "RestFB test"));

+6

, , , manage_pages. , . this

0

Since ur generates an access token from the java class. u can set the permissions required from the user in the ur-link to the ur application from the facebook user profile page and get the access token here.

0
source

All Articles