Can a progressive web app be registered as a share option in Android?

后端 未结 3 1509
清歌不尽
清歌不尽 2020-12-23 16:54

Total newbie question.

Tl;dr - Can a progressive web app be registered as a share option in Android?

In Android, we can “Share” things to other installed And

3条回答
  •  一生所求
    2020-12-23 17:27

    Yes. Now, you can do it on Chrome for Android from version 71+.

    Assuming you have all the basics of PWA nailed down (HTTPS, registered service worker, and manifest) you only need to add the following section into your manifest.json:

      "share_target":
      {
        "action": "/share",
        "params":
        {
          "title": "title",
          "text": "text",
          "url": "url"
        }
      },
    

    I wrote a more detailed tutorial if you get stuck at any stage.

提交回复
热议问题