Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PWA icons are not used in iOS 11.3

Now I'm testing PWA on iOS 11.3 and I use the manifest.json file below:

{   "name": "Maplat PWA Sample",   "short_name": "Maplat PWA",   "background_color": "#fc980c",   "icons": [{     "src": "/Maplat/pwa/icon-96.png",     "sizes": "96x96",     "type": "image/png"   },{     "src": "/Maplat/pwa/icon-144.png",     "sizes": "144x144",     "type": "image/png"   },{     "src": "/Maplat/pwa/icon-192.png",     "sizes": "192x192",     "type": "image/png"   },{     "src": "/Maplat/pwa/icon-256.png",     "sizes": "256x256",     "type": "image/png"   }],   "start_url": "/Maplat/debug.html?overlay=true",   "display": "standalone" } 

This works well except icon setting. In my iOS 11.3 on iPhoneX, icon files are not shown on home screen but screen capture is used as launcher button.

I compared my manifest with other sites, like https://www.ft.com/ or https://r.nikkei.com/, but I couldn't find any differences in icon settings. Icons of these sites work well with PWA on iOS 11.3.

What is wrong in my manifest.json?

P.S. My manifest.json works well with Android Chrome.

like image 554
kochizufan Avatar asked Mar 30 '18 04:03

kochizufan


People also ask

Are PWA supported on iOS?

Apple is a crucial company for the multi-device world, owning iOS, iPadOS, macOS, and Safari. While Apple has never used the term PWA in public, they've been supporting the technologies to make a PWA installable and offline-capable since 2018 on Safari for iPhones and iPads.

How do I update my PWA icon?

Use the Android task manager to shut down the PWA, then use the App panel in Android settings to force stop the PWA. In Chrome, open about://webapks and click the "Update" button for the PWA. "Update Status" should change to "Pending". Launch the PWA, and verify it's loaded properly.

What does not provide a valid Apple touch icon PWA?

When iOS Safari users add Progressive Web Apps (PWAs) to their home screens, the icon that appears is called the Apple touch icon. You can specify what icon your app should use by including a <link rel="apple-touch-icon" href="/example. png"> tag in the <head> of your page.

What is a PWA icon?

With the advent of PWA (Progressive Web Apps), the icons are configurable in a web manifest file. Progressive Web Apps allow web applications to be installed on a device. You can create a shortcut on the mobile home screen. Tap open the icon to launch the application in its own window.


2 Answers

While iOS 11.3 does support web app manifests, it does not yet support specifying icons this way. You'll want to include it in your manifest for other devices, but at least for now you'll have to use the following for iOS:

<link rel="apple-touch-icon" sizes="180x180" href="icon.png"> 

Specify the icon size, and include a URL.

Learn more at Apple's documentation here

There is also a website to automate the process linked here

like image 93
Terren Avatar answered Sep 16 '22 15:09

Terren


TerPro's answer is correct but as a fallback you can put a file named "/apple-touch-icon.png" in the root directory.

like image 37
DrinkOps Avatar answered Sep 18 '22 15:09

DrinkOps