iOS 11.3 中的 WKWebView 中的 Service Worker 不可用 [英] Service Workers unavailable in WKWebView in iOS 11.3

查看:72
本文介绍了iOS 11.3 中的 WKWebView 中的 Service Worker 不可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Service Worker 在 iOS 11.3 测试版的 WKWebView 中可用,但在 iOS 11.3 的最终 GM 版本中似乎不可用.

有谁知道如何在 iOS 上的 WKWebView 中重新启用 Service Workers?

解决方案

WKWebView 中的 Service Workers 现在需要授权:

com.apple.developer.WebKit.ServiceWorkers,它应该作为 Boolean 添加到 .entitlements plist 中,值为.

目前这仅适用于 iOS 模拟器,直到 Apple 更新 Apple Developer Portal 以创建包含此权利的 App ID 和配置文件.

有关更多信息,请参阅此错误:

不幸的是,在 iOS 14 中似乎仍然如此.

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?

解决方案

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.

这篇关于iOS 11.3 中的 WKWebView 中的 Service Worker 不可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆