我想要实现的是PWA商店,使用户可以轻松地在其主屏幕上添加图标以启动PWA网站。请指教。
答案 0 :(得分:0)
如果您要在网络市场中获取要提交的PWA的图标,则可以从以下任一链接标签中获取PWA
启动图标:
<link rel="icon" sizes="192x192" href="nice-highres.png"> (recommended)
<link rel="icon" sizes="128x128" href="niceicon.png">
<link rel="apple-touch-icon" sizes="128x128" href="niceicon.png">
<link rel="apple-touch-icon-precomposed" sizes="128x128" href="niceicon.png">
或通过manifest.json
图标部分:
{
"short_name": "Maps",
"name": "Google Maps",
"icons": [
{
"src": "/images/icons-192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "/images/icons-512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": "/maps/?source=pwa",
"background_color": "#3367D6",
"display": "standalone",
"scope": "/maps/",
"theme_color": "#3367D6"
}
答案 1 :(得分:0)
在iOS和Android中都无法实现:
manifest.json
文件来处理有关PWA的信息。我了解Android now lets you install PWAs from the Play Store,但是在那发布它们的过程却很复杂。
答案 2 :(得分:0)
您可以在manifest.json文件中设置要根据主屏幕上的大小显示的图标。
https://developers.google.com/web/fundamentals/web-app-manifest/
"icons": [
{
"src": "/images/icons-192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "/images/icons-512.png",
"type": "image/png",
"sizes": "512x512"
}
]