7

Possible Duplicate:
Facebook post on Friends wall in Android

I have made an app in which i am fetching list of my all FACEBOOK friends, now i want while i do click on any of the friend row then i will be able to post on his/her wall.

So what are the permissions i need to give and what type of code i need to write to do that,

Like: still i have given below permission and written below code onListItemClick

permissions :

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

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 am fetching FbId, name, bday and picture

 public class MyFriend {
private String fbID = " ";
private String name = " ";
private String bday = " "; 
private String pic = " ";

}
Community
  • 1
  • 1
Liza
  • 227
  • 2
  • 16

2 Answers2

12

Now on-wards you can not post to our friend's wall.

Because Facebook has removed the feature from its Graph Api, so that we cannot Post on Friend's Wall

thats why we can only post on our facebook wall only.

SilentKiller
  • 6,944
  • 6
  • 40
  • 75
3

Feature of posting on friend's wall has been removed from the Facebook sdk.

Previously it could have been done by the following code as claimed by this post,

 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){}
Community
  • 1
  • 1
Sahil Mahajan Mj
  • 11,033
  • 8
  • 53
  • 100