在 next.js 中创建 next-pwa

时间:2021-03-01 14:02:04

标签: next.js progressive-web-apps

我想为 Next.js 创建 PWA。我安装了 next-pwa,在公共文件夹中添加了 manifest.json 文件,并添加了链接,但我看不到应用程序的图标。我做错了什么?

清单 json 文件

{
    "short_name": "PlardGold",
    "name": "PlardGold App",
    "icons": [
        {
            "src": "logo-photo.png",
            "sizes": "48x48",
            "type": "image/x-icon"
        },
        {
            "src": "./logo-photo.png",
            "type": "image/png",
            "sizes": "144x144"
        }
    ],
    "start_url": "/",
    "display": "fullscreen",
    "theme_color": "#000000",
    "background_color": "#ffffff",
    "splash_pages": null
}

链接

<link rel="manifest" href="/manifest.json" />
<link href='/logo-photo.png' rel='icon' type='image/png' sizes='16x16' />
<link href='/logo-photo.png' rel='icon' type='image/png' sizes='32x32' />
<link rel="apple-touch-icon" href="/logo-photo.png"></link>
<meta name="theme-color" content="#317EFB"/>

0 个答案:

没有答案