问题
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?
回答1:
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
来源:https://stackoverflow.com/questions/49673399/service-workers-unavailable-in-wkwebview-in-ios-11-3