【问题标题】:How can i bring share option in my angular(6+) PWA app to share media to social apps(Messenger,Whatsapp)?如何在我的 angular(6+) PWA 应用程序中引入共享选项以将媒体共享到社交应用程序(Messenger、Whatsapp)?
【发布时间】:2019-07-11 12:07:34
【问题描述】:

我正在开发一款适用于网络版和移动版的渐进式网络应用程序。我正在寻找一个共享选项来将我生成的 PDF 共享到 Whatsapp(或任何其他社交媒体,如 facebook、Messenger、LinkedIn)。 有什么帮助吗?

【问题讨论】:

    标签: angular share progressive-web-apps


    【解决方案1】:

    您可以使用网络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 }

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-05-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-03-29
      • 1970-01-01
      相关资源
      最近更新 更多