I have tried to initialize service workers, but they only work in the WebView. When I open an iframe from that WebView, they do not function. Below is my implementation. Is this an issue because iOS does not support service workers in iframes? Please help me answer this. 🙇♂️
self.addEventListener('install', event => {
// Apply this service worker immediately
self.skipWaiting();
});
const putInCache = async (request, response) => {
const cache = await caches.open("v1");
await cache.put(request, response);
};
const customCache = async ({ request, preloadResponsePromise }) => {
};
self.addEventListener("fetch", (event) => {
event.respondWith(
customCache({
request: event.request,
preloadResponsePromise: event.preloadResponse,
}),
);
});