If you are trying to send some kind of message to your friends, than using WebDialog. Below is the code that I use and work fine.
private void sendRequestDialog(String msg, String json) { Bundle params = new Bundle(); params.putString("message", msg); params.putString("data", json); WebDialog requestsDialog = (new WebDialog.RequestsDialogBuilder( context, session, params)).setOnCompleteListener( new OnCompleteListener() { @Override public void onComplete(Bundle values, FacebookException error) { if (error != null) { if (error instanceof FacebookOperationCanceledException) { Toast.makeText(context, "Request cancelled", Toast.LENGTH_SHORT).show(); } else { Toast.makeText(context, "Network Error", Toast.LENGTH_SHORT).show(); } } else { final String requestId = values .getString("request"); if (requestId != null) { Toast.makeText(context, "Request sent", Toast.LENGTH_SHORT).show(); } else { Toast.makeText(context, "Request cancelled", Toast.LENGTH_SHORT).show(); } } } }).build(); requestsDialog.show(); }
And this is the message format that is sent to friends
{ "id": "493703870648580", "application": { "name": "Send Requests How To", "id": "403223126407920" }, "to": { "name": "Chris Abe Colm", "id": "100003086810435" }, "from": { "name": "Christine Abernathy", "id": "1424840234" }, "data": "{\"badge_of_awesomeness\":\"1\",\"social_karma\":\"5\"}", "message": "Learn how to make your Android apps social", "created_time": "2012-10-07T17:29:57+0000" }
PKTomar Apr 25 '14 at 7:37 2014-04-25 07:37
source share