简体   繁体   中英

PWA icons not visible on using add to home screen

I have added icons of different sizes (144x144 and 194x194) and created pwa-manifest.json -

{
    "short_name": "app",
    "name": "Application",
    "icons": [
        {
            "src": "assets/images/favicons/favicon-194x194.png",
            "sizes": "194x194 512x512",
            "type": "image/png"
        },
        {
            "src": "assets/images/favicons/apple-touch-icon-144x144.png",
            "sizes": "144x144",
            "type": "image/png"
        }
    ],
    "start_url": "/index.html",
    "background_color": "#fbfcfd",
    "theme_color": "#00aeef",
    "display": "standalone"
}

I also have added this manifest file into index.html and angular-cli.json.

When I tried to add the application in Android 7.0 (using Chrome 61.0.3163.98) it's not showing the icon. I have used different android devices only Motorola Nexus gives desired results.

Please try resetting your devices' cache and reloading the page multiple times. This happened to me one time and it was very aggravating!

add these lines of code to the head of your index.html

<link rel="apple-touch-icon" href="path/to/file.png"></link>
<link rel="shortcut icon" type="image/jpg" href="path/to/file.png"/>

This may isn't the best answer, but it works for me: add the app to home screen twice . The icon will visible after that. (It's may an issue in some models related to the icons folder refreshing).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM