Saturday, October 21, 2017

Android Smart Banner — Manifest for Native App Install Complains About Missing Service Workers

Leave a Comment

I've read Google's documentation, googled around and looked through Stack Overflow, but haven't found any answers to this problem.

I need an Android Smart Banner to install a native app for the web site, and so (as per Google's instructions) have created the following manifest (details stubbed out for privacy reasons):

{   "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"     }   ] } 

Since this is a native app, it doesn't require any service workers, according to Google's guidelines. However, when I open the site and try to add to the home screen (via the developer console), I keep getting the following error:

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.

Do you know why this is happening? It would seem that this things this isn't a native app install, but why would it think that?

I noticed a few suspicious things from the get go, like the fact that it complained about me not having start_url and display, even though the guidelines don't mention it as necessary for a native app.

Could you tell me what I did wrong?

Thanks!

1 Answers

Answers 1

Reading google documentation i can only see some differences that i will put here so you can check:

  • Png Icon size should be 192x192
  • I would remove "start_url" and "display"
  • Be visited by the user twice, over two separate days during the course of two weeks. (This could be important also)
If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment