【发布时间】:2018-12-11 09:29:10
【问题描述】:
这就是我在 index.html 的 head 部分中的内容:
<head>
<meta charset="utf-8">
<title>MeasurementProtocols</title>
<base href="/index.html">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="./assets/icons/apple/touch-icon-ipad.png">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="manifest" crossOrigin="use-credentials" href="manifest.json">
<link rel="apple-touch-icon" href="./assets/icons/apple/touch-icon-iphone.png">
<link rel="apple-touch-icon" sizes="120x120" href="./assets/icons/apple/touch-icon-ipad.png">
<link rel="apple-touch-icon" sizes="152x152" href="./assets/icons/apple/touch-icon-iphone-retina.png">
<link rel="apple-touch-icon" sizes="180x180" href="./assets/icons/apple/touch-icon-ipad-retina.png">
<meta name="theme-color" content="#1976d2">
</head>
如果我想通过 Apple 设备将网页添加到主屏幕,iPhone 会截取屏幕截图作为图标,尽管我将图标添加到 index.html 中,正如苹果描述的那样:https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html
那么我错过了什么,或者它不适用于将 href 指向资产而不是主文件夹?
【问题讨论】:
-
您是否使用 HTTPS 进行测试?它是 iOS 的必需品。
-
@Hannes 不,iOS 不使用清单中的图标,正如我之前读过的那样。如果我错了,请告诉我
-
我知道,但是要使您的标题中的链接正常工作,您的页面必须通过 https 而不是通过 http 传输。你在用 https 吗?
-
@Hannes 我正在使用 https,是的
-
您在 iOS 设备上使用的是 safari 而没有其他浏览器?
标签: ios angular icons progressive-web-apps