1

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?

Adriaan
  • 17,741
  • 7
  • 42
  • 75
King_2015
  • 19
  • 3
  • First you have to submit the app for review for user action permissions. then you will be able to post/share/like on user behalf. – Salman Aslam Oct 13 '15 at 10:09

0 Answers0