I'm trying to implement an 'add to homescreen' banner using Google Chrome's native banner support, with this demo as reference.
https://googlechrome.github.io/samples/app-install-banner/basic-banner/index.html
According to the spec there, the requirements are:
- the page uses a service worker (yep, see below)
- the site is using HTTPS (yep, the site has a valid SSL certificate and I am loading over HTTPS. chrome shows the site as secure and has a green padlock, no errors or warnings in the certificate)
- the app has a manifest declared (yep, see below)
- the manifest has a short_name, 144 pixel icon and a type of 'image/png' (yep, see below)
The manifest I am using is below.
{
"name": "Web app test",
"short_name": "Test",
"icons": [
{
"src": "/resources/launcher-icon-3x.png",
"sizes": "144x144",
"type": "image/png"
}
],
"display": "standalone"
}
Which contains a short_name and a 144 pixel icon of type image/png.
The service worker I am using is a direct copy & paste of this code:
which was recommended in this article:
The service worker has been registered, the manifest is being loaded into the page and the image url is correct, but the banner is not showing.
I also have the chrome://flags/#bypass-app-banner-engagement-checks enabled so this isn't a case of me needing to come back tomorrow and check that it works. I have been able to view homescreen banners on all of Chrome's demos that I have checked (which is where I took most of this code from) and my phone has the latest version of Chrome installed.
Is there anything else I am missing that could be blocking the homescreen banner from appearing?
Thanks.