Reputation: 51
I am trying to use facebook SDK to implement sharing in my android application, and have implemented exactly like the documentation says on the facebook page . I check for the session and the publish_actions permissions before i call the share dialog as below.
if (FacebookDialog.canPresentShareDialog(getApplicationContext(),
FacebookDialog.ShareDialogFeature.SHARE_DIALOG)) {
// Publish the post using the Share Dialog
FacebookDialog shareDialog = new FacebookDialog.ShareDialogBuilder(this)
.setName("Hello Facebook")
.setDescription("The 'Hello Facebook' sample application showcases simple Facebook integration")
.setLink("http://developers.facebook.com/android")
.build();
}
The share dialogbox appears but it is blank without the content i added in .setLink() etc. Just to be sure I wasnt missing out any configurations, I tested the HelloFacebookSample from the facebook SDK samples and that has the same issue. When i click on "Post Status Update" I see an empty share box.
I am running this on a Nexus 4 phone with Android 4.4.2 and the facebook app version 9.0.0.26.28. Is there something I need to do on my setup to make it work. The strange thing is I do remember seeing the dialog box being populated earlier, so there must be something I have done to break it.
Any help will be appreciated, I have battered my head on this for over a week.
Upvotes: 4
Views: 3830
Reputation: 51
I'm pretty sure it's a facebook bug, because the share gets posted fine to the facebook page, it's only that the share dialog appears to be blank while I am doing it. In fact the same app works fine in other phones, so something particular about my setup that triggers the bug.
I filed a facebook bug and hope it get fixed.
Thanks for the answers everyone.
Upvotes: 1
Reputation: 261
Example from my application:
Definition of uiHelper on the start of MainActivity:
private UiLifecycleHelper uiHelper;
And in the onCreate function:
uiHelper = new UiLifecycleHelper(this, null);
uiHelper.onCreate(savedInstanceState);
And in the corresponding section of my application a call to show the actual share dialog:
FacebookDialog shareDialog = new FacebookDialog.ShareDialogBuilder(this)
.setLink("Hello Facebook")
.setName("The 'Hello Facebook' sample application showcases simple Facebook integration")
.setCaption("http://developers.facebook.com/android")
.setPicture("imageURL")
.build();
uiHelper.trackPendingDialogCall(shareDialog.present());
Just in case i would like to mention that you need to add your Debug Android hash or public keystore hash to the settings of your Application on Facebook control panel under Android tab(More info on key hash generation: Facebook Android Generate Key Hash).
I hope any of my suggestions helps, i was having alot of problems with Facebook SDK aswell.
And does your logcat gives any error or clue to why this is happening?
Upvotes: 0