Intent to Implement: API to support web/native app install banners

639 views
Skip to first unread message

Owen

unread,
Mar 5, 2015, 10:34:35 AM3/5/15
to blin...@chromium.org

Intent to Implement: API to support web/native app install banners


Contact emails

benw...@chromium.org, sligh...@chromium.org, owe...@chromium.org (pm), ta...@chromium.org (pm)


Spec (in progress)

https://github.com/slightlyoff/AppInstallImprovements/blob/master/explainer.md


Summary of feature

Chrome 42 for Android will encourage users to add high quality sites they visit frequently to their home screen. We would eventually like to provide developers control over this banner, including its timing and the ability to show a native app in the banner in place of the web app. Note this is primarily a UA-specific UI feature.


The motivation for the banner is two fold:

  1. Many web developers wish they could place an icon for their web app on the users homescreen to drive more re-engagement. Chrome currently has a menu item which allow users to add a site to their homescreen but it isn’t easily discovered.

  2. Many websites currently implement ‘door slam interstitials’ demanding users install their native app. Our implementation only prompts users to install the app if they have already shown engagement on the site and provides much more respectful UX. We hope developers will adopt this, reducing the number of door slam users experience on the web.


Example of a UI that may be provided to a user after visiting the SVGOMG web app multiple times:


Summary of proposed changes

The triggering of the banner is the decision of Chrome and in the initial implementation will depend on repeat engagement and a minimal site quality bar. This intent covers the minimal API we propose that will allow developers to configure the banner:


  • The related_applications key in the Web Manifest for sites to provide a prioritized list of the various versions of their app that exist (e.g. web app, native android app etc) that the user may want to install.

  • The beforeinstallprompt event allows developers to detect when the prompt has been shown and what the user's choice was. The spec includes a proposal that allows developers to postpone Chrome from showing the banner but we do not expect to block our eventual intent to ship on that feature.


This feature relates to Safari's Smart App Banners, but is distinct as it supports installing apps from many platforms (including web apps) generically. This new API provides the site with more insight into the user interactions with the banner via the beforeinstallprompt event.


Ongoing technical constraints

None


Is this feature supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Android: Yes

Windows, Mac, Linux, ChromeOS: Not today, but we plan to support them in the future

Android WebView: No, it’s not obvious how a feature like this would be supported in web view

iOS: No, we are unable to support this due to platform limitations


Compatibility Risk

The new API surface is small and we believe this new feature will move the web forward significantly. We intend to iterate on this feature in collaboration with other browser vendors and to evolve our design as we gather feedback from developers who adopt the API-less version of the banner in M42.


One minor risk is that the set of outcomes returned by the userChoice promise may change/expand. Today it only supports installed and dismissed.


OWP launch tracking bug?

https://code.google.com/p/chromium/issues/detail?id=459839


Link to entry on the feature dashboard

https://www.chromestatus.com/feature/4540065577435136


Requesting approval to ship?

No

Chris Harrelson

unread,
Mar 6, 2015, 3:13:18 PM3/6/15
to Owen, blink-dev
Not required, but LGTM.

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

jeepersc...@gmail.com

unread,
Jun 7, 2015, 3:04:26 PM6/7/15
to blin...@chromium.org
When will it be possible to control this prompt? I don't plan on door slamming my users but am hesitant to implement this prompt as my Web app is a game with controls at the bottom of the screen. If I don't have control, this would undoubtedly popup over the main game controls. I would like to be able to show it to a player in a non game screen such as you ran out of money, you leveled up ect. Is that possible?

Paul Kinlan

unread,
Jun 7, 2015, 4:48:48 PM6/7/15
to jeepersc...@gmail.com, blin...@chromium.org
You can control this as of Chrome Beta today (Chrome 44).  Control in this case means the ability to cancel the prompt from displaying to the user (rather than proactively forcing a prompt), so you would preventDefault the event on every screen other than the "level-up" screen, although I don't suspect it would actually ever trigger unless you are forcing a page load for each screen of your game.  In the future we will have the ability to delegate the prompt loading to "some point later" in the page life by intercepting the onbeforeinstall event and re-firing later (i.e, at some point in to your game level) 


On Sun, Jun 7, 2015 at 8:04 PM <jeepersc...@gmail.com> wrote:
When will it be possible to control this prompt? I don't plan on door slamming my users but am hesitant to implement this prompt as my Web app is a game with controls at the bottom of the screen. If I don't have control, this would undoubtedly popup over the main game controls. I would like to be able to show it to a player in a non game screen such as you ran out of money, you leveled up ect. Is that possible?

PhistucK

unread,
Jun 7, 2015, 4:53:46 PM6/7/15
to Paul Kinlan, jeepersc...@gmail.com, blink-dev
Kind of off topic, but - preventDefault? I thought the latest TAG (or not TAG, I forget) guidance was not to introduce any new cases where preventDefault does anything in new events.


PhistucK

Mounir Lamouri

unread,
Jun 9, 2015, 5:33:22 PM6/9/15
to Paul Kinlan, jeepersc...@gmail.com, blin...@chromium.org
+domi...@google.com

Dominick is currently working on .pompt() to do the missing bits pointed
by Paul: https://codereview.chromium.org/1160413004

-- Mounir

Mounir Lamouri

unread,
Jun 9, 2015, 5:33:51 PM6/9/15
to Paul Kinlan, jeepersc...@gmail.com, blin...@chromium.org, domi...@google.com
(adding domi...@google.com for real)

Dominick Ng

unread,
Jun 10, 2015, 3:15:41 AM6/10/15
to Mounir Lamouri, Paul Kinlan, jeepersc...@gmail.com, blin...@chromium.org, Alex Russell, Ben Wells
The idea is that developers should be able to delay and re-offer an install prompt to the user in context, but they can't trigger a prompt if it hasn't been offered. The proposed API at https://github.com/slightlyoff/AppInstallImprovements/blob/master/explainer.md#controlling-installation consists of calling e.preventDefault(), then e.prompt() some time later to retrigger the event.

e.prompt() returns a promise indicating whether the retrigger was successful. The promise is rejected if prompt() is called before preventDefault(), or called a second time.
Reply all
Reply to author
Forward
0 new messages