How to post on my wall using restfb

How do I post on my wall using restfb?

I am using this code

    PostData(String accessToken) {
      facebookClient = new DefaultFacebookClient(accessToken);
     void runMessage() {
            String messageId = publishMessage();
 String publishMessage() {
    System.out.println("* Feed publishing *"); 
    FacebookType publishMessageResponse = facebookClient.publish("me/feed", FacebookType.class, Parameter.with("message", "RestFB test"),Parameter.with("link", ""));



source to share

2 answers

Your code works fine with me. Have you added publish_stream permission to your permissions?

See here for details .



This code works fine for me:

static final String MY_ACCESS_TOKEN;

static{MY_ACCESS_TOKEN  = 


login to facebook then copy your access token from "" and paste it here



FacebookClient facebookClient = new DefaultFacebookClient(MY_ACCESS_TOKEN);

void post(String message){




All Articles