Services Worker in WKWebView

Hi, we have a services worker configured in a web page to work offline. The page is loaded in the WKWebView component and we observe that the services worker is not registering correctly, is this component compatible with the API of the services worker? If so, how would be the correct implementation, if it is not compatible, what alternatives are there? thanks!

Hi! Service Workers are not available for WKWebView, except if your app has web browser entitlement. You may try to use regular Workers instead and store data in IndexedDB, LocalStorage or Cookies. Read here about Service Workers in WKWebView: https://forums.developer.apple.com/forums/thread/722160

You may try as well using App-Bound Domains to have Service Workers available for your specific domain.

Services Worker in WKWebView
 
 
Q