Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Progressive Web App icon on splash screen is extremely small

I've successfully created a PWA for my site, but after I've added it to my home screen and I open up the app, the icon on the splash screen remains extremely small.

My manifest has both a 192x192 and 512x512 icon, but as I've read from here (https://developers.google.com/web/updates/2015/10/splashscreen), it picks the closes to 128dp to display. Since a the A2HS banner requires a 192x192 in the manifest, does that mean that the splash screen icon will always be super small? Is there no way to make the icon larger for the splash screen?

like image 849
daitienshi Avatar asked Mar 21 '18 12:03

daitienshi


People also ask

How do I change my PWA icon?

You can change the default icon path to a custom path, using the iconPath parameter in the @PWA annotation.

What is splash screen app icon?

A splash screen is what users see when the app is launched, before it has loaded. The icon will be visible on the users' home screen when the app is installed, or inside of the Expo Go app when in development.

How do I show splash screen in PWA?

So, if you want to set a custom PWA splash screen and icons, the only way out is to add special HTML tags. For splash screens, it is the <link rel=”apple-touch-startup-image” /> meta tag. For icons, you should add one more HTML meta tag – <link rel=”apple-touch-icon” />. That done, your iOS headache isn't over.

Is not configured for a custom splash screen PWA?

Chrome for Android automatically shows your custom splash screen as long as you meet the following requirements in your web app manifest: The name property is set to the name of your PWA. The background_color property is set to a valid CSS color value. The icons array specifies an icon that is at least 512x512 px.


2 Answers

TL;DR: remove your 192x192 icon and your splash screen should default to the 512x512 icon.

Check out this issue about auditing icon size on the Google Chrome Lighthouse issues which provides the following:

...There are 2 layouts for splash screens. You get the "small icon layout" if the icon you provide is <= 80dp. You get the "large icon layout" if it's over >80 dp. Ideal size for splash screen is 128dp. (There is also a way that a non-provided icon is used, though it's unclear what that is.)

It seems that if there is an icon at 192x192 in the manifest.json that an icon at 512x512 will not be used. Check the comments in the link above for some discussion on this - it remains an open issue.

I had the same problem with my PWA and tested removing the 192x192 image leaving the 512x512 and the splash screen icon was larger. I think I will try having a 1024x1024 and removing the 512x512 next build.

EDIT: I tried the 1024x1024 and confirmed there are only 2 layouts depending on the dp. The 1024x1024 didn't display and the splash screen defaulted to a smaller one I had at 384x384.

like image 78
nclarx Avatar answered Nov 15 '22 14:11

nclarx


When we create react app by default 512x512 192x192 this property not have in manifast.json icon size, so that Web app icon get change on splash screen of Mobile/Desktop/Tablet etc. In manifest.json need to configure following way, if you are developing react project then you can find manifest.json file in public/manifest.json directory.

{
  "short_name": "thefarmerson",
  "name": "This is official page of Karthikeyan Anbazhagan Indian Computer Science Engineer",
  "icons": [
    {
      "src": "favicon.ico",
      "sizes": " 512x512 192x192 64x64 32x32 24x24 16x16",
      "type": "image/x-icon"
    }
  ],
  "start_url": "./index.html",
  "display": "standalone",
  "theme_color": "#000000",
  "background_color": "#ffffff"
}
like image 43
KARTHIKEYAN.A Avatar answered Nov 15 '22 12:11

KARTHIKEYAN.A