Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Web Install] Launching already installed app #849

Open
felipe-dialpad opened this issue Aug 2, 2024 · 1 comment
Open

[Web Install] Launching already installed app #849

felipe-dialpad opened this issue Aug 2, 2024 · 1 comment
Assignees
Labels
Web Install API Declarative install for web apps from a web app.

Comments

@felipe-dialpad
Copy link

The Web Install explainer says that getInstalledRelatedApps can be used to check if the app is already installed, and in such case, hide the Install button.

However, if instead of hiding we would like to show a "Launch" button, it seems that this isn't a use case currently supported, but I think it is a very valuable one. You can achieve this with custom protocol handlers, but that is much more invasive and prone to errors. I think as part of this spec it would be nice to add an open() function to the returned object from getInstalledRelatedApps to allow it to be launched.

@felipe-dialpad felipe-dialpad added the Web Install API Declarative install for web apps from a web app. label Aug 2, 2024
@amandabaker
Copy link
Member

I don't see it mentioned in the explainer, but we've discussed using navigator.install() to open apps as well. This was intended to address the issue where a user installs the app from one source (browser UI or web store), and later tries to install it again from a different web store via navigator.install(). If the API rejected with an AbortError and didn't offer to open the already-installed app, then it would be both a bad look for the web store and an inconvenience for users.

Instead, we proposed handling this scenario by allowing the UA to request to open the app, resolving the promise if the user accepts, or rejecting if the user cancels. Then subsequent calls to getInstalledApps() could list the "newly installed" app so the store knew to show an "Open" button instead of an "Install" button. @diekus Do you remember if anyone had any pushback about this approach or should it be safe to include in the explainer?

That said, it wouldn't be intuitive to use navigator.install() to open an already-installed app, so it may make sense to add the navigator.open() you suggested which:

  • has the same params as install
  • only prompts the user to open the app if it is installed and was installed by this origin (i.e. is included in the result of navigator.getInstalledApps()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Web Install API Declarative install for web apps from a web app.
Projects
None yet
Development

No branches or pull requests

3 participants