O'Reilly logo

Hybrid Mobile Development with Ionic by Gaurav Saini

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Service workers

Using service workers with Ionic 3 is really easy, Ionic comes with the service-worker.js file, which is initially commented in the index.html file. We just need to uncomment that section and you will see service workers registered in your browser.

Service workers essentially act as proxy servers that sit between web applications and between the browser and network (when available). They are intended to (amongst other things) enable the creation of effective offline experiences, intercepting network requests, and taking appropriate action based on whether the network is available and updated assets reside on the server. They will also allow access to push notifications and background sync APIs.

A service worker has life cycle ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required