2017-10-12 46 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」和「顯示」
  • 用戶在兩週的兩天內分兩次訪問用戶。 (這也可能很重要)