Reputation: 371
I want my PWA's service worker to run after the user reboot its phone.
The only answer I found on the topic is 1.5 year old, and from what I read the field evolved a lot in that time-frame, so I was wondering if today it was possible yet ?
EDIT:
I double-checked and realized it's already doing that. After testing my service worker on my phone the first time, I rebooted the phone, and then notifications weren't coming in anymore. I therefore assumed service workers weren't surviving reboot. But it probably was my phone taking forever to load it, because I tried again and this time it worked ...
Upvotes: 2
Views: 651
Reputation: 10870
iOS support has been added from version 11.3 (even if still quite behind compared to other competitors).
You can verify it on Can I Use web site:
A service worker is a kind of web worker running on a separate thread, different from the one used by the web site.
You can have a look at this article (part of PWAs series), if you want to get more details about Service Workers.
Added from the comment
The service worker gets activated automatically after the reboot. It is an independent process running on its own thread. That's also the reason why we can still receive notifications even when we are not currently visiting the target website
Upvotes: 2