-2

I am trying to post a message on Facebook wall through my application. I want to post "yeehaa, you are on facebook now"

I am using this code:

btnPostToWall.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
        public void onClick(View v) {
            //postToWall();
            Bundle parameters = new Bundle();
            parameters.putString("message", "jk");
            try {
                facebook.request("me/feed", parameters, "POST");
            } catch (FileNotFoundException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (MalformedURLException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }

    }
});

The issue is-

This code opens my facebook wall for me where i write down a message, instead of it i want to post message through my application pragmatically. how can i do this?

Hassaan Rabbani
  • 2,469
  • 5
  • 30
  • 55

1 Answers1

0

This is called the message property of the feed. Unfortunately, you cannot add this parameter in case of the Feed Dialog, but if you use the Graph API you can add message.

Graph API to publish a feed: /me/feed, it has the message parameter, and other parameters used to publish a feed.

Sahil Mittal
  • 20,697
  • 12
  • 65
  • 90