Try to add website to bookmarks (or to "Favourites") on iOS or iPadOS.
iOS or iPadOS device will load apple-touch-icon.png
from url in <link rel="apple-touch-icon">
tag (or from '/apple-touch-icon.png'
url if <link rel="apple-touch-icon">
does not presented).
Icon is not showing.
My icon is:
/static
folder and available via /apple-touch-icon.png
link. Some time ago I switched my website from vanilla Vue to nuxt.js for Server-Side Rendering (SSR). And now my apple-touch-icon not showing in bookmarks (only on home screen as web app).
I spent a lot of time to find errors. I'd trying to:
sizes
attribute;@nuxtjs/pwa
with automatically generated icons;nuxt.config.js
: change options order, add build.extractCSS: true
property (I'd trying to find a difference between my website and other websites using nuxt.js, like https://bootstrap-vue.js.org);But I couldn’t get apple-touch-icon in bookmarks.
A few days ago I found website with the similar trouble:
Both websites are similar. But №1 working as SPA. №2 working similar to my website.
And №1 have an icon when I'm trying to save it to the bookmarks (screenshot). №2 haven't icon (screenshot). I can't understand why.
My question: how can I show apple-touch-icon in bookmarks?
P.S. I'm always use "Clear History and Data" in settings. And always trying to repeat adding multiple times.
Me website working on Cloudflare, but I tried do the same on dev version, without Cloudflare.
apple-touch-icon
added to nuxt.config.js
to head.link
:
{ rel: 'apple-touch-icon', href: '/apple-touch-icon.png' }
Also I'm using @nuxtjs/[email protected]
, but I disabled favicon property in nuxt.config.js
to use custom favicons: pwa.meta.favicon: false
.
I also tried to ask this question on Stack Overflow (https://stackoverflow.com/questions/59460657/cannot-show-apple-touch-icon-in-bookmarks-with-nuxt-js-app) and Apple support (https://discussions.apple.com/thread/250974245), but there are no answers.
I'm forgot notice that tried to change webserver (nginx) config. No results for me.
Indeed this is weird, it works when I try to add it as home screen shortcut:
But not on bookmarks
Experiencing exactly the same issue. Please, anyone, help to solve it.
Any things about this issue?
Hey 👋🏼
I can report that there is a workaround: using the „icon“ submodule of the @nuxtjs/pwa module.
Working example website (which is open source): https://www.lichter.io
@manniL as you can see in my first message, I'm already using @nuxtjs/pwa
module. I tried to use/change/remove icon
submodule, but apple-touch-icon still not working
@kernel-picnic Weird 🤔 I'm not using anything else to generate the icons and the correct icons are displayed as shown above.
Thanks for your contribution to Nuxt.js!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you would like this issue to remain open:
Issues that are labeled as pending
will not be automatically marked as stale.
I'm not using @nuxt/pwa, but experiencing same issue
nuxt v2.11.0
Steps to reproduce:
Reopened this issue for now. Would really appreciate a minimal codesandbox or GitHub repo for reproduciton
@manniL https://q5b97.sse.codesandbox.io here you go
I’ve encountered the same issue today (April 3, 2020)
apple-touch-icon.png
Shows:
Does not show:
The solution appears to be use WWW.example.com, notice the uppercase
@kernel-picnic Weird 🤔 I'm not using anything else to generate the icons and the correct icons are displayed as shown above.
Your domain has ‘www.’ — it happens to be the solution
Having www is unfortunately not a solution. Although it's so iffy that it makes sense it would be.
tl;dr adding apple-touch-icon-120x120-precomposed.png
and/or apple-touch-icon-120x120.png
to the domain root fixed it for us. So something like example.com/apple-touch-icon-120x120-precomposed.png
.
The longer version: the whole thing is just insane. It works on many pages that do not have these files in the root, so it would indicate that it works without it too. In my/our case it worked on different test environments, but not on prod and I had to spend days figuring it out.
One hint that it's not necessarily the apple-touch-icon specified in the document came from the BBC. If you bookmark bbc.com you will get an icon that does not resemble the apple-touch-icon linked in the document. After a lot of checking, testing, using that favicon checker that gave us an OK for everything, yet it still didn't work, in the end I fired up wireshark to see what the damn thing actually requests.
If you open the share menu, it will try this (on ios 13 at least where there's an icon):
so the linked icon in the document is only the third url it will try, and only if all others fail. If you then try to bookmark it will request apple-touch-icon-120x120-precomposed.png
. In my case it succeeded immediately so I don't know when or if it tries one of the linked icons in the document. I checked the server logs and found requests for apple-touch-icon-120x120-precomposed.png
and apple-touch-icon-120x120.png
, added them and it worked. I guess I could also check if it requests the icon we linked to, but I don't really care anymore.
Having www is unfortunately not a solution. Although it's so iffy that it makes sense it would be.
tl;dr adding
apple-touch-icon-120x120-precomposed.png
and/orapple-touch-icon-120x120.png
to the domain root fixed it for us. So something likeexample.com/apple-touch-icon-120x120-precomposed.png
.The longer version: the whole thing is just insane. It works on many pages that do not have these files in the root, so it would indicate that it works without it too. In my/our case it worked on different test environments, but not on prod and I had to spend days figuring it out.
One hint that it's not necessarily the apple-touch-icon specified in the document came from the BBC. If you bookmark bbc.com you will get an icon that does not resemble the apple-touch-icon linked in the document. After a lot of checking, testing, using that favicon checker that gave us an OK for everything, yet it still didn't work, in the end I fired up wireshark to see what the damn thing actually requests.
If you open the share menu, it will try this (on ios 13 at least where there's an icon):
so the linked icon in the document is only the third url it will try, and only if all others fail. If you then try to bookmark it will request
apple-touch-icon-120x120-precomposed.png
. In my case it succeeded immediately so I don't know when or if it tries one of the linked icons in the document. I checked the server logs and found requests forapple-touch-icon-120x120-precomposed.png
andapple-touch-icon-120x120.png
, added them and it worked. I guess I could also check if it requests the icon we linked to, but I don't really care anymore.
Unfortunately, it didn't help me:( added that icons in the root folder, checked requests with Charles, 200 OK, icons found, but still not displayed in bookmarks (but for Home screen web clip it works as expected)
are there any news? Still having this issue in my application.
I solved the problem with this solution.
https://stackoverflow.com/a/64959404/11845221
Most helpful comment
Experiencing exactly the same issue. Please, anyone, help to solve it.