简体   繁体   English

Android Facebook Share Dialog的内容未在主页中显示

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

I using "ShareDialog" for sharing a link from my app to Facebook wall. 我使用“ShareDialog”分享从我的应用程序到Facebook墙的链接。 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. 它显示链接未公开共享,如果公开图标更改为globe图标。

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 . 1)我不知道Facebook API是否允许在帖子上设置权限,但您可以尝试, 请参阅API文档

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. 2)默认情况下,许多用户将共享权限设置为私有,通过进入Facebook设置,查看您的帐户是否默认为私有。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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