简体   繁体   English

苹果触摸图标不显示在手机上

[英]Apple touch icon not showing on mobile Phones

I'm currently struggling to get the apple-touch-icon to appear on mobile Phones.我目前正在努力让苹果触摸图标出现在手机上。 In Safari on my Laptop, the icon is displayed as as part of the tab and in my bookmarks.在我的笔记本电脑上的 Safari 中,该图标显示为选项卡和书签的一部分。 On mobile phones however, it does not show up.然而,在手机上,它不会出现。 From my research, I should be doing it right but it still doesn't work.根据我的研究,我应该做对了,但它仍然不起作用。 I'm testing it on a stage envrionment as the site I'm working on is not live yet.我正在舞台环境中对其进行测试,因为我正在开发的网站尚未上线。

This is my implementation of the apple-touch-icons:这是我对苹果触摸图标的实现:

<link rel="apple-touch-icon" href="/build/favicon/apple-touch-icon.png" />
<link rel="apple-touch-icon" sizes="152x152" href="/build/favicon/apple-touch-icon-152x152.png" />
<link rel="apple-touch-icon" sizes="167x167" href="/build/favicon/apple-touch-icon-167x167.png" />
<link rel="apple-touch-icon" sizes="180x180" href="/build/favicon/apple-touch-icon-180x180.png" />

My project also contains a manifest.json file which contains all the paths and I reference it like this:我的项目还包含一个 manifest.json 文件,其中包含所有路径,我像这样引用它:

 <link rel="manifest" href="manifest.json" crossorigin="use-credentials">

When I'm on the website, I can also open the manifest file in the dev tools, so the browser definitely has access to it.当我在网站上时,我也可以在开发工具中打开清单文件,所以浏览器肯定可以访问它。

Can anyone help me figure out what the problem might be here?谁能帮我弄清楚这里可能存在什么问题?

For anyone running into this issue - my "problem" ended up being testing on the stage environment.对于遇到此问题的任何人-我的“问题”最终在舞台环境中进行测试。 It worked in production.它在生产中起作用。 So the way I'm showing in the example is correct.所以我在示例中展示的方式是正确的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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