2017-10-12 44 views
1

我已阅读谷歌的文档,搜索并浏览了Stack Overflow,但没有找到任何解决此问题的答案。安卓智能横幅 - 本地应用程序的清单安装投诉关于丢失服务人员

我需要一个Android的智能横幅安装本机应用程序的网站,等等(按照谷歌的说明)已经创建了如下清单(详情掐灭出于保护隐私):

{ 
    "short_name": "ShortName", 
    "name": "Longer App Name", 
    "start_url": ".", 
    "display": "standalone", 
    "icons": [ 
    { 
     "src": "icon.png", 
     "type": "image/png", 
     "sizes": "144x144" 
    } 
    ], 
    "prefer_related_applications": true, 
    "related_applications": [ 
    { 
     "platform": "play", 
     "id": "com.app.name" 
    } 
    ] 
} 

由于这是一个本地应用程序,它不需要任何服务人员,according to Google's guidelines。然而,当我打开该网站,并尝试(通过开发者控制台)添加到主屏幕上,我不断收到以下错误:

Site cannot be installed: no matching service worker detected. You may need to reload the page, or check that the service worker for the current page also controls the start URL from the manifest.

你知道为什么发生这种情况?看起来这个东西不是原生的应用程序安装,但为什么会这样认为呢?

我注意到了一些可疑的事情,比如它抱怨我没有start_url并显示,尽管指南没有提到它是原生应用程序的必要条件。

你能告诉我我做错了什么吗?

谢谢!

回答

1

阅读google documentation我只能看到一些区别,我将放在这里,所以你可以检查:

  • 巴图标大小应为192x192
  • 我会删除“START_URL”和“显示”
  • 用户在两周的两天内分两次访问用户。 (这也可能很重要)