Service worker in ionic1

Hi,

I would like add service worker to my project in ionic 1. Is it possible?

I used this code PhilJ’s gists · GitHub and I have a error

service worker error DOMException: Failed to register a ServiceWorker: The URL protocol of the current origin (‘file://’) is not supported.

Service worker needs https so how it works in ionic 2?

Best
Lukasz