Facebook Share Dialog Box on Android Not Showing Content

I am trying to use the facebook SDK to implement sharing in my android application and implemented just like the documentation is written on the facebook page . I check session permissions and publish_actions permissions before invoking the sharing dialog, as shown 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 dialog will appear, but it is empty without the content that I added to .setLink (), etc. Just to make sure that I didn't miss any configurations, I tested HelloFacebookSample from the facebook SDK samples and had the same problem. When I click "Update Message Status", I see an empty field for exchange.

I run this on a Nexus 4 phone with Android 4.4.2 and in the facebook app 9.0.0.26.28. Is there anything I need to do for my setup to make it work. The strange thing is: I remember that the dialog box used to be populated, so there must be something I did to break it.

Any help would be appreciated, I spent my head on it for more than a week.

+4
source share
2 answers

, facebook, facebook, , , . , - , .

facebook , .

.

+1

:

uiHelper MainActivity:

private UiLifecycleHelper uiHelper;

onCreate:

uiHelper = new UiLifecycleHelper(this, null);
uiHelper.onCreate(savedInstanceState);

:

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());

, Android Facebook Android ( : Facebook Android Generate Key Hash).

, , Facebook SDK.

logcat - , ?

0

Source: https://habr.com/ru/post/1540941/


All Articles