我不确定如何与我的网站https://example.com/test
分享链接。
如果我打开Facebook网站并粘贴https://example.com/test
,则预览中会填充我在HTML文档中设置的og:
标签(标题,说明,图片)。
如果我尝试与Facebook SDK共享链接,可以选择一个选项:
ShareLinkContent content = new ShareLinkContent.Builder()
.setContentUrl(contentUrl)
.setContentTitle(title)
.setContentDescription(message)
.setImageUrl(imageUrl)
.build();
但它需要我来添加标题,说明等,而我想从我的网站上获取它们。我想要facebook网站的相同行为,从og标签获取预览。
另一个选项可能是ShareOpenGraphContent
,但在示例中,我看到它用于以编程方式添加og标记,而不是共享符合opengraph的网页。
怎么做?