try to improve support for PWA on iOS

This commit is contained in:
Dobromir Popov
2024-05-07 16:52:21 +03:00
parent c6d376c64d
commit d727cebb55
3 changed files with 15 additions and 2 deletions

View File

@ -14,8 +14,7 @@ class MyDocument extends Document {
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
<meta name="apple-mobile-web-app-title" content="CCOM" />
<link rel="apple-touch-icon" href="/old-192x192.png"></link>
<link rel="apple-touch-icon" href="/favicon.ico"></link>
</Head>
<body>
<Main />

View File

@ -2,6 +2,16 @@
"theme_color": "#ffffff",
"background_color": "#e36600",
"icons": [
{
"src": "pwa-192x192.png",
"sizes": "192x192",
"type": "image&#x2F;png"
},
{
"src": "pwa-512x512.png",
"sizes": "512x512",
"type": "image&#x2F;png"
},
{
"purpose": "maskable",
"sizes": "512x512",

View File

@ -124,6 +124,10 @@ nextApp
next();
});
server.use("/favicon.ico", express.static("public/favicon.png"));
// serve the same image for pwa-192x192.png and pwa-512x512.png
server.use("/pwa-192x192.png", express.static("public/favicon.png"));
server.use("/pwa-512x512.png", express.static("public/favicon.png"));
server.use("/manifest.json", express.static("public/manifest.json"));
//all static files are served from the public folder, including subfolders
server.use(express.static("public")); //ToDo: not working for some reason
// server.use("/robots.txt", express.static("styles/favicon_io/robots.txt"));