Deep linking from Web to PWA (Standalone Version)

Alex29 picture Alex29 · Aug 31, 2017 · Viewed 7.7k times · Source

I have a web app that it can be installed as standalone application in the homescreen thanks to PWA standard.

When a user forget his password, a email is sent to him with a link to reset the password.

Question is:

Can I deep-link to the already-installed standalone version instead of the web application in chrome browser? I'd like to achieve this behaviour:

  • User clicks in email link from gmail application.
  • OS check if link matches with any url schema pre-registered in the system (This is the step that I don't really know if it's possible from web right now)
  • If found, open the standalone version. Otherwise, open the browser.

Thanks in advance!

Cheers

Answer

Gardner Bickford picture Gardner Bickford · May 1, 2018

There is an example of describing intent filters in json here. The relevant section of the manifest is intent_filters

{
  "manifest_package": "org.chromium.webapk.test",
  "scope_url": "https://pwa.rocks/",
  "intent_filters": {
    "scope_url_scheme": "https",
    "scope_url_host": "pwa.rocks",
    "scope_url_path": "/"
  },
  "start_url": "https://pwa.rocks/",
  "display_mode": "standalone",
  "orientation": "portrait",
  "theme_color": "2147483648L",
  "background_color": "2147483648L",
  "icon_urls_and_icon_murmur2_hashes": "http://www.pwa.rocks/icon1.png 0 http://www.pwa.rocks/icon2.png 0",
  "web_manifest_url": "https://pwa.rocks/pwa.webmanifest",
  "version_code": "1",
  "version_name": "1.0",
  "bound_webapk": {
    "runtime_host": "org.chromium.chrome",
    "runtime_host_application_name": "Chromium"
  }
}