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

Install prompts: Allow manual prompting but not automatic prompting #576

Closed
mgiuca opened this issue May 10, 2017 · 7 comments
Closed

Install prompts: Allow manual prompting but not automatic prompting #576

mgiuca opened this issue May 10, 2017 · 7 comments

Comments

@mgiuca
Copy link
Collaborator

mgiuca commented May 10, 2017

Implementations may wish to show a prompt if, and only if, the site explicitly requests it via BeforeInstallPromptEvent.prompt(), but not automatically without the site's approval. Is this something we want to leave to the discretion of the user agent? (This would require changing the language in §2.5 "Install prompts": "steps to notify before an automated install prompt" would become "steps to notify that an install prompt is available".)

@mgiuca mgiuca changed the title BeforeInstallPromptEvent: Allow manual prompting but not automatic prompting Install prompts: Allow manual prompting but not automatic prompting May 10, 2017
@kenchris
Copy link
Collaborator

I guess if we do that, developers will learn to always prompt as soon as they are able to, making the auto prompting more or less useless and forcing the developers to do a bit more work.

@mgiuca
Copy link
Collaborator Author

mgiuca commented May 10, 2017

@owencm I think the reports and data we're getting from developers suggests that they are not happy with us spontaneously showing a prompt and would actually prefer to control the experience rather than have it pop up at a random time. (In fact I believe many developers are calling preventDefault and never prompt.)

This would be a proposal to make that the default behaviour, and it would be at the discretion of the user agent. So to put it in the framework I proposed a year ago, there would be 3 classes of site:

  1. Those that want to show a prompt right away. They should call prompt() in the beforeinstallprompt event handler.
  2. Those that want to not show a prompt ever, or show it later at a controlled time. They should call preventDefault() (and perhaps prompt() later).
  3. Those that don't care. They don't have an event handler, and they just take the default behaviour at the discretion of the user agent.

This allows user agents to provide what they believe is the best default experience, while site developers can customize to obtain either behaviour.

@marcoscaceres
Copy link
Member

I'm supportive of the model in #576 (comment) . @mgiuca, could you please draft a PR with the new language?

@mgiuca
Copy link
Collaborator Author

mgiuca commented May 15, 2017

Will do.

@delapuente
Copy link

But I thought that was already possible, calling preventDefault and keeping the event for later as explained here: https://developers.google.com/web/fundamentals/engage-and-retain/app-install-banners/#deferring_or_cancelling_the_prompt

@mgiuca
Copy link
Collaborator Author

mgiuca commented May 24, 2017

@delapuente Sorry, maybe I wasn't clear. By "allow manual prompting", I mean for user agent implementors, not web sites. That is, we want to make it legal for a user agent to fire a beforeinstallprompt event (and let the site prompt manually) but not show an automatic prompt if the site fails to call preventDefault.

@delapuente
Copy link

I see. Makes sense. Thank you for the clarification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants