user1361891
user1361891

Reputation: 11

Facebook android post on the wall Permission error

I would like to post a message on the wall without a dialog to pop up I have tried

parameters.putString("description", "test test test")
response = mFacebook.request("me/feed", parameters, "feed");

Or

response = mFacebook.request("me/feed", parameters, "stream.publish");

And I get an error

Got response: `{"error":{"message":"Unsupported method, feed","type":"Exception"}}`

The Code Posted Below is how to post a message on the wall without dailog in order to slove the issue, you need to add premission when you create facebook object see below

*final String FACEBOOK_PERMISSION = "publish_stream"; mPermissions = new String[]{FACEBOOK_PERMISSION};*

Upvotes: 0

Views: 1047

Answers (1)

Aerrow
Aerrow

Reputation: 12134

Use this code

 public void postOnWall(String msg) {
    Log.d("Tests", "Testing graph API wall post");
     try {
            String response = facebook.request("me");
            Bundle parameters = new Bundle();
            parameters.putString("message", msg);
            parameters.putString("description", "test test test");
            response = facebook.request("me/feed", parameters, 
                    "POST");
            Log.d("Tests", "got response: " + response);
            if (response == null || response.equals("") || 
                    response.equals("false")) {
               Log.v("Error", "Blank response");
            }

     } catch(Exception e) {
         e.printStackTrace();
     } 
}

Upvotes: 1

Related Questions