简体   繁体   English

iOS Safari 添加到我的 Angular Web 应用程序图标的主屏幕作为屏幕截图而不是 apple-touch-icon

[英]iOS safari add to home screen of my angular web app icon coming as screenshot instead of apple-touch-icon

When I'm trying to add my angular web app as a shortcut to my home screen from my iOS safari it is coming as a screenshot of my app page, although I added an apple-touch-icon link to my index.html.当我尝试将我的 angular Web 应用程序作为快捷方式从我的 iOS Safari 添加到我的主屏幕时,它会作为我的应用程序页面的屏幕截图出现,尽管我在我的 index.html 中添加了一个 apple-touch-icon 链接。 where my image is 150*150 size and a png.我的图像是 150*150 大小和一个 png。 below is my HTML code下面是我的 HTML 代码

<!doctype html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <title>Insights</title>
  <base href="/">

  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="icon" type="image/x-icon" href="src/assets/icons/favicon-32x32.png">
  <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&amp;display=swap" rel="stylesheet">
  <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
  <link rel="manifest" href="manifest.webmanifest">
  <link rel="apple-touch-icon" href="src/assets/icons/apple-touch-icon-150x150.png">
  <meta name="theme-color" content="#1976d2">
</head>

<body>
  <app-root></app-root>
  <noscript>Please enable JavaScript to continue using this application.</noscript>
</body>

</html>

After some research found that it is my bad having src in the below line.经过一些研究发现,在下面的行中使用 src 是我的坏事。

<link rel="apple-touch-icon" href="src/assets/icons/apple-touch-icon-150x150.png">

changed it to the below worked将其更改为以下有效

<link rel="apple-touch-icon" href="/assets/icons/apple-touch-icon-150x150.png">

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

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