I'm trying to get my installed PWA to open when a QR code opens a URL in a browser. Have I got this set up correctly, or am I misunderstanding something, please?
For testing my PWA was installed from Chrome, and I'm testing putting the above URL in a Chrome browser on an Android phone.
The URL I'm putting in my browser is...
https://test.mysupersite.com?book=GGGGG
...where 'book' could be any 5 character alpha-numeral
I have a file named web-app-origin-association which is in a folder named .well-known in the root of my website i.e https://test/mysupersite.com/.well-known. It contains:
{
"web_apps": [
{
"manifest": "https://test.mysupersite.com/manifest.webmanifest",
"details": {
"paths": ["/*"]
}
}
]
}
My web manifest is named manifest.webmanifest and is also in my site's root...
https://test.mysupersite.com/manifest.webmanifest
It contains...
{
"name": "MySuperSite",
"short_name": "MySuperSite",
"gcm_sender_id": "XX47XX2560XX",
"display": "standalone",
"gcm_user_visible_only": true,
"start_url": "/?mode=standalone",
"theme_color": "#ffffff",
"related_applications": [{
"platform": "webapp",
"url": "https://test.mysupersite.com/manifest.webmanifest"
}],
"url_handlers": [
{
"origin": "https://test.mysupersite.com"
},{
"origin": "https://*.mysupersite.com"
}
],
"background_color": "black",
"description": "Do super things",
"icons": [
{
"src": "/imgs/PWA-icon-512.png",
"type": "image/png",
"sizes": "512x512"
},
{
"src": "/imgs/PWA-icon-192.png",
"type": "image/png",
"sizes": "192x192"
}
]
}
If my PWA installs fine (which it does), should putting https://test.mysupersite.com?book=GGGGG in a Chrome browser on an Android phone open the installed PWA?
I've also tried putting https://test.mysupersite.com (no query string) in the browser, but it also doesn't work.
Thank you for your time and help.
Make sure you enabled the #enable-desktop-pwas-url-handling
flag
This API only works with links opened outside of the browser, like in messaging apps. It won't work when you enter the URL into the browser. Quoting the docs,
Navigations that start in a browser tab are not handled by this proposal