Html Whatsapp图像通过react js与文本共享
我试图通过我的网站在WhatsApp上实现链接共享(文本+图像)。我已经实现了OG标签 在头上-Html Whatsapp图像通过react js与文本共享,html,reactjs,whatsapi,share-open-graph,Html,Reactjs,Whatsapi,Share Open Graph,我试图通过我的网站在WhatsApp上实现链接共享(文本+图像)。我已经实现了OG标签 在头上- <meta property="og:locale" content="en_US" /> <meta property="og:type" content="website" /> <meta property="og:title" content="Yuva
<meta property="og:locale" content="en_US" />
<meta property="og:type" content="website" />
<meta property="og:title" content="Yuva Registration" />
<meta property="og:description" content="Register to get benefits" />
<meta property="og:site_name" content="Yuva" />
<meta property="og:url" content="http://ad-test.easygov.co.in/PanAdvertisement/"/>
<meta property="og:image" itemProp="image" content="http://ad-test.easygov.co.in/advertisement/test.png"/>
<meta property="og:image:type" content="image/png"/>
在我体内-
<link itemprop="thumbnailUrl" href="http://ad-test.easygov.co.in/advertisement/test.png" />
<span itemprop="thumbnail" itemscope itemtype="http://schema.org/ImageObject" >
<link itemprop="url" href="http://ad-test.easygov.co.in/advertisement/test.png" />
</span>
我通过验证我的标记,一切似乎都正常,调试器正在获取我的所有标记
这是Whatsapp锚定标签-
<a href="https://web.whatsapp.com/send?text= Please Visit https://easygov.co.in/PanAdvertisement"
rel="nofollow noopener" target="_blank"
className="share-icon"><img src="/img/share-icon.png" style={{height:'36px'}}/>Share via Whatsapp</a>
但是关于分享,我只收到一条短信——请访问
我不知道我错过了什么或做错了什么
谢谢 事实证明,您无法实现此跨域。一旦我在og:URL中将WhatsApp标签的href-URL更改为一个匹配项,它就开始按照我希望的方式工作
<a href="https://web.whatsapp.com/send?text= Please Visit http://ad-test.easygov.co.in/PanAdvertisement"
rel="nofollow noopener" target="_blank"
className="share-icon"><img src="/img/share-icon.png" style={{height:'36px'}}/>Share via Whatsapp</a>
如果您想在Whatsapp应用程序而不是web应用程序上共享,可以使用以下内容-
<a href="whatsapp://send?text= Please Visit http://ad-test.easygov.co.in/PanAdvertisement" rel="nofollow noopener" target="_blank" className="share-icon"><img src="/img/share-icon.png" style={{height:'36px'}}/>Share via Whatsapp</a>