It is not possible to send private messages on behalf of the user using the api schedule.
However, you should use the Send Dialog , although I have not tried it on Android, but it should be something like:
Bundle params = new Bundle(); params.putString("to", "USER_ID"); params.putString("name", "TITLE HERE"); params.putString("link", "A URL"); // this link param is required facebook.dialog(context, "send", params, new DialogListener() { @Override public void onComplete(Bundle values) { .... } @Override public void onFacebookError(FacebookError error) {} @Override public void onError(DialogError e) {} @Override public void onCancel() {} });
Another approach you can use is the chat API , with which you can send messages as a user, this requires xmpp_login permission, and you must implement the xmpp client.
Edit
Since this dialog is not yet supported on Android, you have 3 options:
- Wait for the dialog box for Android to appear on facebook.
- Try opening a dialog box in a browser (the URL that is in the documents) on your mobile device.
- Request
xmpp_login and add the xmpp client (for example: asmack ), and with this you can implement your own Send Message dialog box.
Nitzan Tomer May 26 '12 at 10:58 a.m. 2012-05-26 10:58
source share