问题
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