【问题标题】:facebook Share image Url along with link in androidfacebook分享图片网址以及android中的链接
【发布时间】:2017-12-15 00:34:49
【问题描述】:

我想与链接一起分享图片网址。以前我使用 shareLinkContent 来共享图像和 URL,但现在无法正常工作。

                        shareDialog = new ShareDialog(activity);

                        ShareLinkContent content = new ShareLinkContent.Builder()

                                .setImageUrl(Uri.parse(image)).setContentUrl(Uri.parse(shareUrl))

                                .build();
                        shareDialog.show(content);

这是我的代码,它仅共享内容 Url 不共享图像 Url。是否有任何其他方式可以将链接与图像一起共享到 Facebook。请帮助我解决此问题。

【问题讨论】:

  • 嘿@gowthami,你有什么解决办法吗?

标签: android image facebook url


【解决方案1】:
private void sharePhotoToFacebook() {
    Bitmap image = BitmapFactory.decodeResource(getResources(), R.drawable.b);
    SharePhoto photo = new SharePhoto.Builder()
            .setBitmap(image)
            .build();
    SharePhotoContent content = new SharePhotoContent.Builder()
            .addPhoto(photo)
            .build();
    ShareApi.share(content, null);

}

【讨论】:

  • 感谢您的回复。但我想分享链接和图片
【解决方案2】:

Facebook Doc

自 2017 年 4 月 18 日起,不再支持以下参数 通过 Graph API 2.9 及更高版本。对于 2.8 及更低版本, 参数将继续有效,直到 2017 年 7 月 17 日。

  • contentTitle 表示链接中内容的标题
  • imageURL,将在帖子中显示的缩略图的 URL
  • content描述内容,一般2-4句

【讨论】:

  • 我可以分享两个到 facebook 的链接
  • @gowthami 我们不能共享多个链接
  • 那么我如何与链接共享图像。有没有其他方法可以做到这一点。@Vishal
  • @gowthami 不可能
  • @VishalYadav 这个有什么解决办法吗?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-05-08
  • 1970-01-01
  • 1970-01-01
  • 2016-11-26
  • 2013-02-16
  • 2015-11-04
相关资源
最近更新 更多