iOS WKWebView Service Worker
Asked Answered
H

0

8

As of iOS 15 appCache is disabled. So I am looking for alternative.

Is there an official way to enable WKWebView Service Workers?

I know that you can add info.plist key for WKAppBoundDomains and then enable them by instantiating the WKWebViews with limitsNavigationsToAppBoundDomains = YES enabled in the config. This will allow you to use service workers for the domains you have specified in the WKAppBoundDomains. Can I rely on this? I haven't found any Apple articles mentioning it.

Hufford answered 19/1, 2022 at 14:29 Comment(6)
I tested this functionality with iOS14 and found the service worker to be patchy on wkwebview. Some app restarts it would register and work. Other times nothing. Same code, same app, sometimes SW sometimes none. I haven't tested in iOS15 as I've been other projects and haven't heard anything new. If you have more info I'm also interested.Violinist
Any update for service worker?Artema
Haven’t looked into it after posting. I am using the “workaround”Hufford
@Hufford what "workaround" do you use?Selfpollination
@Selfpollination the one with WKAppBoundDomains mentioned in the questionHufford
@Hufford does that mean ios actually restricts other requests? that's a big limitationBreaker

© 2022 - 2024 — McMap. All rights reserved.