I have to send a message to a facebook friend via an android app.I have done all functions and tried a code to send message to facebook friend.But it showing an error that the dialog is not available for this device.
Here is my code to send a message to facebook friend:
Facebook facebook = new Facebook(APP_ID);
Bundle params = new Bundle();
params.putString("to", Constant.facebookIdBuffer.toString());
params.putString("name", "Goal Machine");//title
params.putString("link", Constant.shortAppUrlForAndroid+"\n"+Constant.shortAppUrlForIphone);//message
facebook.dialog(_activity, "send", params, new DialogListener() {//apprequests
@Override
public void onComplete(Bundle values) {
Constant.facebookIdBuffer=null;
//postToWall("@"+Constant.facebookIdBuffer.toString()+sendInvite);
}
@Override
public void onFacebookError(FacebookError error) {
Constant.showAlertDialog("Error", "Can't send ally request!", _activity.getParent(), false);
Constant.facebookIdBuffer=null;
}
@Override
public void onError(DialogError e) {
Constant.showAlertDialog("Error", "Can't send ally request!", _activity.getParent(), false);
Constant.facebookIdBuffer=null;
}
Here is the screen short showing error:
Please suggest me a way to send a message with links to facebook friend.