Eamonn McEvoy
Eamonn McEvoy

Reputation: 8986

Native app install banner not working

I cant get a native app install banner to display on android. I've added the following 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"
        }
    ]
}

When I look at the application tab in chrome dev tools is see:

enter image description here

Why isn't are the fields begin populated? The json is valid, I can click on the /Assets/manifest.json link and see the contents. What am I missing here?

Upvotes: 2

Views: 1386

Answers (2)

Abdul Rahim K A
Abdul Rahim K A

Reputation: 11

Use below example in manifest.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"
        }
      ]
    }

Upvotes: 1

Eamonn McEvoy
Eamonn McEvoy

Reputation: 8986

Got it working, two things needed to be done:

  1. Open up manifest in sublime and change encoding from UTF8 with BOM to UTF8

  2. Unable to test in chrome or android emulator(as it cannot access the play store). You need to add a proxy to your dev machine on an actual android device and access the running site over https (in my case it involved creating a https iis binding to route through)

Upvotes: 2

Related Questions