With help of this post and this tutorial I have managed to integrate Facebook on my Android app with latest FacebookSDK. I want to publish some contents so used the tutorial and its working totally fine. My only issue is that I am not able to see the publish dialog box (as mentioned in the tutorial), where as I want it to be shown as I want user to modify the contents of the message. How do I do this?
Here is a snapshot of the code I am using to publish the post.
public void postToWall(String message){
Bundle parameters = new Bundle();
parameters.putString("message", message);
parameters.putString("description", "topic share");
try {
facebook.request("me");
String response = facebook.request("me/feed", parameters, "POST");
Log.d("Tests", "got response: " + response);
if (response == null || response.equals("") ||
response.equals("false")) {
showToast("Blank response.");
}
else {
showToast("Message posted to your facebook wall!");
}
finish();
} catch (Exception e) {
showToast("Failed to post to wall!");
e.printStackTrace();
finish();
}
}
with permissions as
private static final String[] PERMISSIONS = new String[] {"publish_stream"};
I also found that there is something called facebook.dialog() but I have no idea where and how to use it.
So, how do I show the publish dialog box?
Code you used will publish on wall without Dialog.
Use below code snippet to show Dialog :
Where authenticatedFacebook is Facebook object.