使用Android在LinkedIn上分享帖子



我有一个安卓内置的应用程序,我需要在LinkedIn上分享一篇带有预定义内容的帖子,这些内容可以是图片或URL。我如何实现这一点?

提前谢谢。

步骤1-共享URL

要在LinkedIn上共享URL。。。

https://www.linkedin.com/sharing/share-offsite/?url={url}

来源:MSD领英官方分享文档

步骤2-设置图像、标题、说明等

在HTML的<head>块中设置og:标签,就像这样…

  • <meta property='og:title' content='Title of the article'/>
  • <meta property='og:image' content='//media.example.com/ 1234567.jpg'/>
  • <meta property='og:description' content='Description that will show in the preview'/>
  • <meta property='og:url' content='//www.example.com/URL of the article' />

来源:领英分享文档:让你的网站在领英上共享

步骤3-验证您的代码

您可以使用LinkedIn帖子检查器来验证您的网站是否按预期显示。在此处插入您的URL(example.com(,而不是要与之共享的URL(linkedin.com?url=example.com(。

如果你认为你得到了过时的缓存结果,你可以通过将?someFakeParameter=123添加到你的测试URL来欺骗Post Inspector和Share API,使其绕过缓存。

最新更新