我的Angular渐进式Web应用程序无法搜索

N S*_*rma 8 angular pwa

我正在构建一个Angular渐进式Web应用程序.我希望我的应用程序行为像本机应用程序,但是我遇到一些问题,如果你希望它的行为像本机应用程序那样不应该存在.

我已将其构建为PWA,并且已成功添加到我的主屏幕上.应用程序和图标都显示在主屏幕上.但我面临的问题是:

  • 当我在搜索它时,就像我在手机上搜索其他应用程序一样,它不在列表中.但我已经使用Flipkart Lite测试了这个场景,我已将其添加到我的主屏幕中,当我搜索它时,它出现在应用程序列表中.

我的manifest.json是:

{
  "name": "beautyOfSoul",
   "gcm_sender_id": "103953800507",
  "short_name": "beautyOfSoul",
  "theme_color": "#1976d2",
  "background_color": "#fafafa",
  "display": "standalone",
  "scope": "/",
  "start_url": "/",
  "icons": [
    {
      "src": "assets/icons/icon-72x72.png",
      "sizes": "72x72",
      "type": "image/png"
    },
    {
      "src": "assets/icons/icon-96x96.png",
      "sizes": "96x96",
      "type": "image/png"
    },
    {
      "src": "assets/icons/icon-128x128.png",
      "sizes": "128x128",
      "type": "image/png"
    },
    {
      "src": "assets/icons/icon-144x144.png",
      "sizes": "144x144",
      "type": "image/png"
    },
    {
      "src": "assets/icons/icon-152x152.png",
      "sizes": "152x152",
      "type": "image/png"
    },
    {
      "src": "assets/icons/icon-192x192.png",
      "sizes": "192x192",
      "type": "image/png"
    },
    {
      "src": "assets/icons/icon-384x384.png",
      "sizes": "384x384",
      "type": "image/png"
    },
    {
      "src": "assets/icons/icon-512x512.png",
      "sizes": "512x512",
      "type": "image/png"
    }
  ]
}
Run Code Online (Sandbox Code Playgroud)

我的app.module.ts文件正在导入服务工作者:

environment.production ? ServiceWorkerModule.register('ngsw-worker.js') : [], ServiceWorkerModule.register('/ngsw-worker.js', { enabled: environment.production })
Run Code Online (Sandbox Code Playgroud)

您可以在下面找到截图: 在此输入图像描述 在此输入图像描述

请让我知道如何才能实现这一目标.

Dam*_*n J 2

检查您是否已将元标记添加到 HTML 中。某些移动操作系统需要某些元标记才能使 PWA 发挥作用。

请检查此内容以获取有关 PWA 元的更多信息。https://github.com/gokulkrishh/awesome-meta-and-manifest

<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1">
<meta name="mobile-web-app-capable" content="yes">
<meta name="application-name" content="App name">
<link rel="icon" sizes="192x192" href="./logo.png">

<!-- Add to homescreen for Safari on iOS -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="App Name">
<link rel="apple-touch-icon" href="./logo.png">

<!-- TODO: Tile icon for Win8 (144x144 + tile color) -->
<!-- <meta name="msapplication-TileImage" content="ms-touch-icon-144x144-precomposed.png"> -->
<!-- <meta name="msapplication-TileColor" content="#3372DF"> -->

<meta name="theme-color" content="#9fa2a3">
Run Code Online (Sandbox Code Playgroud)