WICG / get-installed-related-apps

proposal to add an API to the web for determining if related apps are installed
http://wicg.github.io/get-installed-related-apps/spec/
Other
42 stars 14 forks source link

Include self when the requesting web app is installed #9

Open petele opened 5 years ago

petele commented 5 years ago

One way to determine if your own web app is installed would be to include itself when the web app calls navigator.getInstalledRelatedApps().

For example: [{id: "self", platform: "web", url: "https://example.com/"}]

slorber commented 3 years ago

Hey, not sure it's the exact same subject, just wanted to mention that I find it weird that somehow the manifest of the PWA has to reference itself.

Also, not allowing relative URLs can be annoying because we need to add the full URLs to the manifest instead of just ./manifest to self-reference.

I've been able to get PWA installations on Netlify deploy previews (ie random URLs): https://6048f504e1bdbb0007b0c76c--docusaurus-2.netlify.app/classic

But couldn't make the await navigator.getInstalledRelatedApps() method return anything else than an empty array.

@petele in your example, isn't platform supposed to be "webapp" and URL supposed to target the json manifest URL?

What I'd like in the end is to be able to write [{platform: "webapp", url: "./manifest.json"}].

But if this could be somehow made for me, this would be better. In the end I think it makes sense for a PWA to be able to know easily if it's installed or not. (I'm just looking for a replacement of appinstalled event)