Deep linking from Web to PWA (Standalone Version)
Asked Answered
M

3

32

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.

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.
Milagro answered 31/8, 2017 at 10:28 Comment(1)
what did you end up doing? Do you have a working and reliable solution at all?Mclendon
C
9

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"
  }
}
Cecilacecile answered 1/5, 2018 at 17:24 Comment(3)
is it working for PWA ios and desktop devices as well ?Mitchum
I don't think this works in any browsers. I have tested it in iOS Safari and Android Chrome and none of them worked. Did I missed something or the feature is removed?Oxysalt
The feature is still in Chrome Android. The PWA needs to be installed for this to work. There are a lot of things that could go wrong during a PWA installation. You can read more here: developers.google.com/web/updates/2015/12/getting-started-pwaCecilacecile
H
1

If you set your scope properly in the manifest.json file, all links in other applications will open in the standalone version instead of the browser. Note that links in the browser will still prefer the browser version instead of the standalone. For example:

"start_url": "/",
"scope": "/",
"display": "standalone"

Note: Navigating directly to https://example.com/app/ from the address bar will work exactly as the same as it does for native apps that have an intent filter. Chrome assumes the user intended to visit the site and will open this site.

Source: developers.google.com/web/fundamentals/integration/webapks

Hahn answered 29/11, 2018 at 10:29 Comment(0)
S
-2

Configure the Android Intent Filters in Web App Manifest as shown here

Stapes answered 27/12, 2017 at 13:2 Comment(2)
The question is about PWA, not Android. This is an invalid answer.Magisterial
Actually this answer is about PWA it's about "Add to home screen" prompt so yeah it is invalid because it has nothing to do with intent filters not because it's about "Android" whatever you mean by that.Cariole

© 2022 - 2024 — McMap. All rights reserved.