Service Workers were available in WKWebView
in iOS 11.3 betas, but do not appear to be available in the final GM version of iOS 11.3.
Does anyone know how to re-enable Service Workers in WKWebView
on iOS?
Description. Since iOS14, it's possible to make service workers works in WKWebView by providing a list of trusted domains (up to 10). These domains then gain support for service workers, which is invaluable for us as we plan to use server.
WKWebView - This view allows developers to embed web content in your app. You can think of WKWebView as a stripped-down version of Safari. It is responsible to load a URL request and display the web content. WKWebView has the benefit of the Nitro JavaScript engine and offers more features.
UIWebView APIs are still supported in the upcoming iOS 13 release as well as macOS Catalina but are still going away in future releases. Sometime in the future, iOS apps may be blocked from release to the App Store when Apple decides to enforce blocking apps that use UIWebView.
In Chrome 48 we've made the switch from UIWebView to WKWebView, leading to dramatic improvements in stability, speed, responsiveness, and web compatibility.
Service Workers in WKWebView
now require an entitlement:
com.apple.developer.WebKit.ServiceWorkers
, which should be added to the .entitlements
plist as a Boolean
with a value of YES
.
Currently this will only work in the iOS Simulator, until such time as Apple update the Apple Developer Portal to make it possible to create App IDs and Provisioning Profiles containing this entitlement.
For more information see this bug: https://bugs.webkit.org/show_bug.cgi?id=182865 and associated change set: https://trac.webkit.org/changeset/228933/webkit
EDIT: Unfortunately still seems to be the case in iOS 14.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With