How to post a message on Facebook friends wall in Android

Possible duplicate:
Facebook on the friends wall in Android

I created an application in which I upload a list of all my FACEBOOK friends , now I want, as long as I click on any of the lines of each other, then I can post his / her walls.

So what permissions do I need and what code do I need to write to do this,

It seems: I also gave below permission and wrote below code onListItemClick

permissions:

mFacebook.authorize(main, new String[] { "publish_stream", "friends_birthday", "friends_photos" }, new MyAuthorizeListener()); 

The code:

  @Override protected void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); MyFriend friend = (MyFriend) this.getListAdapter().getItem(position); } 

I get FbId, name, bday and image

  public class MyFriend { private String fbID = " "; private String name = " "; private String bday = " "; private String pic = " "; } 
+7
source share
2 answers

Now you can’t send a message to our friend’s wall.

Since Facebook removed the function from its Graph Api , so we cannot Post on Friend Wall

that’s why we can only post facebook on our wall.

+15
source

The post function on a friend’s wall has been removed from sdk Facebook.

Previously, this could be done using the following code, as stated in the message,

  try{ Bundle parameters = new Bundle(); JSONObject attachment = new JSONObject(); try { attachment.put("message", "Messages"); attachment.put("name", "Get utellit to send messages like this!"); attachment.put("href", link); } catch (JSONException e) { } parameters.putString("attachment", attachment.toString()); parameters.putString("message", "Text is lame. Listen up:"); parameters.putString("target_id", "XXXXX"); // target Id in which you need to Post parameters.putString("method", "stream.publish"); String response = authenticatedFacebook.request(parameters); Log.v("response", response); } catch(Exception e){} 
+3
source

All Articles