Serve PWA icons from fresh /icons/v2/ URLs with every iOS size
Publish Container / publish (push) Successful in 2m43s
Publish Container / publish (push) Successful in 2m43s
iOS showed a letter tile ('N') when adding to the Home Screen. The live files were fine, but a
reverse proxy in front of the app serves static files with a long cache lifetime (live icon.svg
and sw.js were stale) and iOS remembers a failed icon per URL.
- New versioned URLs no proxy/phone has cached; old paths kept for existing installs
- apple-touch-icon declared at 180/167/152/120 (opaque 8-bit RGB PNGs) for app and dashboard
- 180px icon also listed in both manifests; notification icons and root fallbacks use v2
- Service worker cache bumped
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
19479daece
commit
f21c91527c
29 files changed
+90
-35
No files matched your search
+4
-4
@@ -4,7 +4,7 @@ self.addEventListener('message', event => {
|
||||
if (event.data === 'skipWaiting') self.skipWaiting();
|
||||
});
|
||||
|
||||
const CACHE = 'weather-v13';
|
||||
const CACHE = 'weather-v14';
|
||||
|
||||
// App shell cached on install for offline resilience.
|
||||
const PRECACHE = [
|
||||
@@ -18,7 +18,7 @@ const PRECACHE = [
|
||||
'/alert-info.js',
|
||||
'/app-ui.js',
|
||||
'/manifest.json',
|
||||
'/icons/icon.svg'
|
||||
'/icons/v2/icon.svg'
|
||||
];
|
||||
|
||||
self.addEventListener('install', event => {
|
||||
@@ -44,8 +44,8 @@ self.addEventListener('push', event => {
|
||||
event.waitUntil(
|
||||
self.registration.showNotification(payload.title || 'NeCloud Weather', {
|
||||
body: payload.body || '',
|
||||
icon: '/icons/icon-192.png',
|
||||
badge: '/icons/icon-192.png',
|
||||
icon: '/icons/v2/icon-192.png',
|
||||
badge: '/icons/v2/icon-192.png',
|
||||
tag: payload.tag || 'weather-alert',
|
||||
data: { url: payload.url || '/' },
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user