[英]How can i bring share option in my angular(6+) PWA app to share media to social apps(Messenger,Whatsapp)?
我正在開發可同時在網絡版本和移動版本上使用的漸進式Web應用程序。 我正在尋找一個共享選項,以將我生成的PDF共享到Whatsapp(或任何其他社交網站,如facebook,Messenger,LinkedIn)。 有幫助嗎?
您可以使用Web Share API
if ('share' in navigator) { navigator.share({ title: document.title, text: text, url: location.href, }) } else { // Here we use the WhatsApp API as fallback; remember to encode your text for URI location.href = 'https://api.whatsapp.com/send?text=' + encodeURIComponent(text + ' - ') + location.href }
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.