简体   繁体   中英

Missing message or attachment error while sending message in Facebook

I am integrating Facebook in my app and I could do with ease,but I am facing a problem when I am trying to post a message with hyperlink on the wall, when I am trying to do this I am getting Missing message or attachment OauthException code 100, I was able to post a message without hyperlink. This is the code which I am using for posting on 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 any one tell me where I am going wrong? Thank you.

Try doing 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");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM