Implementing Two Different PWA Icons Based on Device Width
We would like to use two different PWA icons for our application.
We intend to use different icons based on the device width. Specifically, we want to display "mobile.png" when the device width is below 768 pixels, and we want to display "desktop.png" when the device width is above 769 pixels. (See attachment 1)
We manipulated the manifest.webmanifest file to achieve this:
{
"sizes": "128x128",
"src": "resources/icons/mobile.png",
"type": "image/png",
"purpose": "any maskable",
"media": "(max-width: 768px)"
},
{
"sizes": "128x128",
"src": "resources/icons/desktop.png",
"type": "image/png",
"purpose": "any maskable",
"media": "(min-width: 769px)"
},
But we always see mobile.png when we try to install our VBSC app as a PWA app on whichever device we have. Our condition does not work. (See attachment 2)