问题
In these demos, there are logos on the splash screens.
https://addyosmani.com/blog/getting-started-with-progressive-web-apps/
I don't know what I am doing wrong in my manifest - I have an icon but it is not showing up on my splash screen.
My manifest looks like this:
{
"short_name": "Weather Service",
"name": "Weather Service",
"icons": [
{
"src": "logo.png",
"sizes": "144x144",
"type": "image/png"
}
],
"start_url": "index.html",
"display": "standalone",
"orientation": "portrait",
"background_color": "#FAFAFA",
"theme_color": "#512DA8"
}
Do I need more than 1 image for it to appear on the splash screen?
回答1:
PWA is recommend to alway put icon at 192px as a minimum
If you want to ensure that an icon will always be displayed consider that 48dp is the minimum image size we will display, which if you take the maximum density display currently supported (4x) then 48 * 4 = 192px. This is lucky because we need to 192px image for Add to Homescreen to work! Yay. Therefore, I would recommend always having 192px as the minimum sized icon and create 3 other versions at 256px, 384px and 512px. However, if you want to ensure that the user is not downloading too much data for the splash screen, especially on a low density device then you can go lower and Chrome will try to fetch the most appropriate image.
https://developers.google.com/web/updates/2015/10/splashscreen
回答2:
You can also validate your icons by using the "Add to homescreen" action under Chrome's dev tools (Application -> Manifest). This identified a 192x191px
image which was causing it to fail for me.
来源:https://stackoverflow.com/questions/38575456/logo-not-appearing-on-splash-screen-of-progressive-web