2

I'm working on a PWA, which is a share-target as specified in the manifest.json. This PWA is installed (to the Homescreen) on my Android 8.1 device with Chrome 73 for Android.

When sharing web pages, this seems to work. I successfully receive the title and text parameters. Due to limitations of Android, I don't know if I'm ever getting the url parameter.

However, when sharing images specifically (so not just pages, links, text) by long-clicking an image in Chrome, and press "Share Image" - my PWA does not show up in the list of possible targets. Dropbox, Bluetooth, Telegram etc. do show up, but my PWA does not.

Question: how can I make my PWA show up for "Share Image" sharing?

manifest.json

{
  "share_target": {
    "action": "/#/share-target/",
    "method": "GET",
    "enctype": "application/x-www-form-urlencoded",
    "params": {
      "title": "title",
      "text": "text",
      "url": "url",
      "files": [{
        "name": "file",
        "accept": ["*/*"]
      }]
    }
  }
}

Changing to POST does not seem to work either:

manifest.json

{
  "share_target": {
    "action": "/#/share-target/",
    "method": "POST",
    "enctype": "multipart/form-data",
    "params": {
      "title": "title",
      "text": "text",
      "url": "url",
      "files": [{
        "name": "file",
        "accept": ["*/*"]
      }]
    }
  }
}
3
  • As far as I'm aware, no browsers support images for the Web Share API. Commented Apr 22, 2019 at 18:13
  • Basically trying to reproduce youtu.be/lNOP5dcLZF4?t=773 where it seems at least somewhat possible. Commented Apr 22, 2019 at 18:40
  • The video description says "just landing in Chrome Canary" so you probably need Chrome 75 or 76. Commented Apr 23, 2019 at 14:56

1 Answer 1

1

I know that this is a old question, but for anyone looking I've found here that support for sharing files was added in chrome 76.

Support for text and data was added in Chrome 71, and support for files was added in Chrome 76.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.