Missing message or attachment error while posting to Facebook

I integrate Facebook into my application, and I could do it with ease, but before I try to send a message with a hyperlink on the wall, when I try to do this, I get a Missing message or Attachment OauthException code 100, I was able to post a message without hyperlinks. This is the code I use to post to the wall:

JSONObject attachment = new JSONObject(); attachment.put("message", "Messages"); attachment.put("name", "click"); attachment.put("href", "http://www.facebook.com"); Bundle parameters = new Bundle(); parameters.putString("attachment",attachment.toString()); response = mFacebook.request("me/feed", parameters,"POST");` 

Can someone tell me where I am going wrong? Thanks.

+4
source share
1 answer

Try to do something like:

 Bundle parameters = new Bundle(); parameters.putString("message", "Messages"); parameters.putString("name", "click"); parameters.putString("link", "http://www.facebook.com"); response = mFacebook.request("me/feed", parameters, "POST"); 
0
source

All Articles