简体   繁体   中英

Android Facebook Share Dialog's content not shown in home page

I using "ShareDialog" for sharing a link from my app to Facebook wall. When i post a link, it shows the content only in user's timeline and not in home page. What i'm doing wrong?

I'm doing something like that:

// This is how i invokes the shareDialog
FacebookDialog shareDialog = createShareDialogBuilderForLink().build();

private FacebookDialog.ShareDialogBuilder createShareDialogBuilderForLink() {
    return new FacebookDialog.ShareDialogBuilder(this)
    .setPicture("picture url")
    .setName("name")
    .setLink("link url");
}

User's timeline:

在此输入图像描述

Home page:

在此输入图像描述

In home page only shows the name of the app which take it from the link i setted(app in google play) without showing the content of the link(descriptiion, name, Caption...).

Its because the user chose to not share the link publicly, do you see the little lock icon alongside the time the link was shared? It shows that link is not shared publicly, if its public the icon changes to globe icon.

What to do now?

1) I don't know whether Facebook API allows to set permissions on the post but you can try, see API documentation .

2) Many users by default set the share permission to private, see whether your account has it private by default by going in Facebook settings.

How about this

ShareDialog shareDialog = new ShareDialog(this);
if (ShareDialog.canShow(ShareLinkContent.class)) {
    ShareLinkContent linkContent = new ShareLinkContent.Builder()
            .setContentTitle("Title")
            .setContentDescription("Description")
            .setContentUrl(Uri.parse("Url"))
            .build();

    shareDialog.show(linkContent);
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM