• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

problem in posting a message on friends wall in facebook

vandit67

Lurker
hello

i have a problem in posting a message on friends wall in facebook.i write below code for posting a message.

private void postwall(){
try {
FBRequest streamRequest = FBRequest.requestWithDelegate(new
FBRequestDelegateImpl());
Map<String, String> parameters = new HashMap<String, String>();

frdlist = new String
[list.size()];
for(int j=0;j < list.size();j++){
if (list.get(j).isChecked()) {
frdlist[j]=String.valueOf(list.get(j).getUserid());
parameters.put("message", "HI.... its a test application of Dates Near Me");
parameters.put("attachment", "{\"name\":\"Facebook Connect for Android\",\"href\":\"http://code.google.com/p/fbconnect-android/\",\"caption\":\"Caption\",\"description\":\"Descr iption\",\"media\":[{\"type\":\"image\",\"src\":\"http://img40.yfrog.com/img40/5914/iphoneconnectbtn.jpg\",\"href\":\"http://developers.facebook.com/connect.php?tab=iphone/\"}],\"properties\":{\"anotherlink\":{\"text\":\"Faceb ook homepage\",\"href\":\"http://www.facebook.com\"}}}");
parameters.put("auto_publish" ,"true");
parameters.put("target_id" ,frdlist[j]);
parameters.put("uid" ,String.valueOf(FBSession.getSession().getUid()));

streamRequest.call("stream.publish", parameters);
}
}


} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();

}

}

i am passing three values: message,target_id and uid...all values i get perfectly.but when i check my friends wall that time message is not display on wall..

so if anybody have a solution than please suggest me

thanx
vandit
 
It would help to have some details. What kind of phone? are you using an app or the website? does this happen all the time? Just with one friend?
 
Bundle params = new Bundle();

String arr[]={"id 1","id 2","id 3"};

for(int i=0;i<arr.length;i++)
{
params.putString("message", "hello ...");//("message", "".getBytes());
//System.out.println("i============"+i);
mAsyncRunner.request(arr+"/feed", params, "POST", new FriendRequestListener(), null);
}
 
Back
Top Bottom