I am trying to implement the prompt for adding to the home screen using manifest.json, but I am facing an issue where the prompt is not showing up even though my PWA score in the audit is 100%.
Below is the structure of my dist folder:
https://i.sstatic.net/yEkuN.png
My Manifest JSON looks like this:
{
"name": "xyz",
"short_name": "xyz",
"icons": [
{
"src": "/xyz/static/img/icons/xy-icon-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/xyz/static/img/icons/xy-icon-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"start_url": "xyz/index.html",
"scope": ".",
"display": "standalone",
"background_color": "#0628b9",
"theme_color": "#000000"
}
I am using the Workbox plugin for the service worker, and I have also tried with a normal service worker as shown below:
sw.js
var VERSION = '20';
self.addEventListener('install', function(e) {
e.waitUntil(caches.open(VERSION).then(cache => {
return cache.addAll([
'https://cfjedimaster.github.io/nomanssky/client/index.html'
]);
}))
});
// Rest of the service worker code ...
Even though my PWA score in Lighthouse is 100%, I am unable to see the prompt to add to the home screen. https://i.sstatic.net/9vOFd.png
If anyone has any insights or suggestions on how to resolve this issue, it would be greatly appreciated.