I followed Google's first PWA tutorial and created my own project https://my-pwa-77d8a.firebaseapp.com. Everything looks fine:
manifest.json
file<meta name="mobile-web-app-capable" content="yes">
tag
manifest.json
{
"short_name": "PizzaApp",
"name": "My delicious PWA",
"icons": [
{
"src": "img/launcher-icon-2x.png",
"sizes": "96x96",
"type": "image/png"
},
{
"src": "img/launcher-icon-3x.png",
"sizes": "144x144",
"type": "image/png"
},
{
"src": "img/launcher-icon-4x.png",
"sizes": "192x192",
"type": "image/png"
}
],
"start_url": "/index.html",
"display": "standalone",
"orientation": "portrait"
}
I can manually add to homescreen both from mobile and desktop. But Chrome never shows the add to homescreen banner. What is wrong?
SOLVED
As pointed bellow, my service worker was trying to cache a missing offline.html
file. I created the file, cleared the phone's cache and everything worked fine.
If you do not see the "Add to Home Screen" option after you have opened the Mobile Gallery App installation link, you are most likely viewing from an unsupported browser (i.e. using the Gmail app on an iOS device, or the Twitter app from an Android device).
Open the menu next to the URL bar. Depending on whether you're using Chrome or Android you'll see a menu option "Install" or "Install App". This is the "Add to Home screen" option displayed for any site that has the necessary features in place.
The problem is that your offline.html
file (https://my-pwa-77d8a.firebaseapp.com/offline.html) is returning 404.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With