How to render whatsapp content in preview dynamically?

爱⌒轻易说出口 提交于 2019-12-12 01:42:28

问题


I have an application where i use dynamically rendering of meta tags. I am using pre render services to render meta content dynamically. It works for facebook, google..etc but for whatsapp it is not able capture dynamic content. It is showing like {{meta.content}}.

How can i remove preview from whatapp while sharing from js?

Is there any solution to capture preview dynamically?


回答1:


If you want to render dynamic content that you need take help of .htaccess.

RewriteCond %{HTTP_USER_AGENT} facebookexternalhit/1.1|Twitterbot|Pinterest|linkedinbot|WhatsApp|Viber|SkypeUriPreview|Google.*snippet [NC,OR]

For more info:

https://gist.github.com/thoop/8072354

https://www.winhelp.info/create-browser-whitelist-with-htaccess.html




回答2:


If you are using Prerender you just need to add the whatsapp user agent to the list of user agents being checked. Whatsapp does not support the escaped fragment crawling protocol.



来源:https://stackoverflow.com/questions/36044782/how-to-render-whatsapp-content-in-preview-dynamically

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!