2017-05-22 78 views
0

我無法獲得原生應用安裝橫幅以在android上顯示。我已經添加了以下masifest.json原生應用安裝橫幅不起作用

{ 
    "name": "My native app", 
    "description": "balh blah blah", 
    "short_name": "myapp", 
    "icons": [ 
     { 
      "src:": "/Assets/app-install-banner-logo.png", 
      "type:": "image/png", 
      "sizes:": "144x144" 
     } 
    ], 
    "prefer_related_applications": true, 
    "related_applications": [ 
     { 
      "platform": "play", 
      "id": "com.my.app" 
     } 
    ] 
} 

當我看到在Chrome瀏覽器開發的應用工具選項卡,請參閱:

enter image description here

爲什麼不能是場開始填充? json有效,我可以點擊/Assets/manifest.json鏈接並查看內容。我在這裏錯過了什麼?

回答

0

得到它的工作,需要做兩件事情:

  1. 開闢從UTF8 with BOM崇高和變化編碼艙單UTF8

  2. 無法在Chrome或Android模擬器測試(因爲它無法訪問Play商店)。您需要將代理添加到您的開發機器上的實際的Android設備上訪問正在運行的網站通過HTTPS(在我的情況下,它是製造一個HTTPS的iis結合借道)

0

使用下面的例子中清單.json

{ 
     "short_name": "Name Of Website", 
     "name": "The Website", 
     "icons": [ 
     { 
      "src": "launcher-icon-0-75x.png", 
      "sizes": "36x36", 
      "type": "image/png" 
     }, 
     { 
      "src": "launcher-icon-1x.png", 
      "sizes": "48x48", 
      "type": "image/png" 
     }, 
     { 
      "src": "launcher-icon-1-5x.png", 
      "sizes": "72x72", 
      "type": "image/png" 
     }, 
     { 
      "src": "launcher-icon-2x.png", 
      "sizes": "96x96", 
      "type": "image/png" 
     }, 
     { 
      "src": "launcher-icon-3x.png", 
      "sizes": "144x144", 
      "type": "image/png" 
     }, 
     { 
      "src": "launcher-icon-4x.png", 
      "sizes": "192x192", 
      "type": "image/png" 
     } 
     ], 
     "display": "browser", 
     "prefer_related_applications": true, 
     "related_applications": [ 
     { 
      "platform": "play", 
      "id": "com.the.appid" 
     } 
     ] 
    }