I'm an android developer and I'm trying to create Facebook app to share on Facebook from an android app, but I have a problem in how to add publish_actions
to the Facebook app.
private static final String APP_ID = "XXXXXXXXXXXXXX";
private static final String[] PERMISSIONS = new String[] { "email", "user_photos", "publish_actions" };
and to log in:
facebook.authorize(this, PERMISSIONS, Facebook.FORCE_DIALOG_AUTH, new LoginDialogListener());
To post:
try {
Bundle parameters = new Bundle();
parameters.putString("message", message);
facebook.request("me");
String response = facebook.request("me/feed", parameters, "POST");
Log.w("Tests", "got response: " + response);
if (response == null || response.equals("") || response.equals("false")) {
Log.v("response", "Blank response.");
} else {
Log.v("response", "Message posted to your facebook wall!");
}
} catch (Exception e) {
e.printStackTrace();
Log.w("Error", "Error1: " + e.toString());
}
I can get all information about user But I can't post on facebook
Can someone help me please?