WKWebView 中的图像上传失败 UnboundedNetworking 缺少所需的客户端权利

Han*_*nes 9 ios swift wkwebview

我正在使用WKWebView包含图像上传的 。本机UIImagePickerController显示,webview正确预览所选图像,但是当我在webview中按下上传按钮时,显示以下错误并且上传失败:

[assertion] Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=3 "Required client entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"UnboundedNetworking" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Required client entitlement is missing}>
[ProcessSuspension] 0x1122f5fc0 - ProcessAssertion: Failed to acquire RBS UnboundedNetworking assertion 'WebKit uploads' for process with PID 35109, error: Error Domain=RBSAssertionErrorDomain Code=3 "Required client entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"UnboundedNetworking" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Required client entitlement is missing}
Run Code Online (Sandbox Code Playgroud)

我在 Apple 开发者论坛中发现有几个人面临同样的问题,但目前还没有解决方案。图像上传本身有效,因为它在 iPhone 上的 Safari 中直接测试时很成功。

这些是我已经尝试过但没有成功的事情:

  • 获得完全 PhotoLibrary 访问权限
  • 搜索了任何可能可用的权利,但一无所获(除了在 MacOS 上可用但在 iOS 上不可用的权利)
  • 尝试添加 MacOS 权限但也不起作用

任何帮助将不胜感激!