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 ...

Get Hybrid Mobile Development with Ionic now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.