How to use service workers in Cordova Android app?

后端 未结 2 951
醉话见心
醉话见心 2020-12-24 05:35

I want to use a service worker in my Cordova Android add as a convenient way to sync some images to and from the server. I notice that this question states that this is not

2条回答
  •  无人及你
    2020-12-24 06:03

    After digging deep into this issue, I conclude that there is no support for Service workers in Android as it blocks service workers from HTTP or file protocols.

    Also the support of Service worker in Ionic framework do not clearly state that it is not supported in hybrid mobile apps. It's kind of misleading too as in this case. Ionic's Service Worker support comes into picture only in case of Progressive Web App and not in hybrid mobile app as mentioned in their official blog

    Adding to the above info, most of the functionality that can be achieved by using Service Workers are already available as part of plugins like push notification plugin which should be suffice in most cases.

    The bottom line is that the Service Workers are not supported in Cordova Android as well as in Ionic framework. For more info, check out the following link

提交回复
热议问题