Why is my 'add to home screen' Web App Install Banner not showing up in my web app

前端 未结 4 2020
星月不相逢
星月不相逢 2020-12-16 14:41

I\'ve created a service-worker and manifest.json file in order to display an \'add to home screen\' Web App Install Banner for Chrome Browser Users.

It

4条回答
  •  借酒劲吻你
    2020-12-16 14:58

    your manifest.json seems good enough. and the above mentioned points by @Extricate are correct and perfect.

    So the next question is have you implemented service-worker for your app?
    I read somewhere that an empty service-worker file would work but when I tried an empty implementation of service-worker, it said that

     'Site cannot be installed: the page does not work offline' 

    So I suppose that latest chrome version would not be supporting the A2HS prompt for APP INSTALL BANNERS if you service-worker dont support offline working.

    You can try going to Basic web app prompt , go to devtools in chrome, navigate to Application tab. There you will find manifest.json. On LHS of the manifest file, you can see the ADD TO HOME SCREEN. When you click, it will print

     'Site cannot be installed: the page does not work offline' 

    PFA screenshot for same

提交回复
热议问题