Creating an android smart app banner
Since Chrome 44 Beta you can push your app in Chrome for Android with a native app install banner on your website. There are a couple of criteria that need to be met in order to enable it:
- You will need a web app manifest file
- You will have to serve your web using https
- The user has visited your site twice over two separate days during the course of two weeks.
Read more about it in the official docs from Google.
You add the Google Sign-In button to your page with a special parameter and then users can sign in and specify which device to install your app to directly from your website.
This is the most "officially supported" implementation I know of:
https://developers.google.com/identity/sign-in/web/android-app-installs
From the link:
By adding the Google Sign-In button to your web site, you can automatically prompt your users to download your Android app over the air to their Android devices. To enable this feature, you must use the same Google Developers Console project for your Web and Android clients, and configure your web app's sign-in button.
Your web app must use the Google Sign-In button to prompt your web site users to download your app the first time that they sign in. This feature is enabled by adding the apppackagename parameter to your sign-in button.
Since Chrome 44 Beta you can push your app in Chrome for Android with a native app install banner on your website.
Please see the answer below.
Old answer
I needed that myself, so I created a jquery plugin to mimic a smart banner for Android and older iOS versions.
http://jasny.github.com/jquery.smartbanner/#android
There are two APIs available:
- To detect if the app is already installed use getInstalledRelatedApps (only for Chrome 80+)
- Article with general information: https://web.dev/get-installed-related-apps/
- Docs and demo (web+app) with code https://www.chromestatus.com/feature/5695378309513216
- Show a prompt to install your app
- Article with code samples: https://web.dev/customize-install/
- Documentation: https://developers.google.com/web/fundamentals/app-install-banners/native