iOS应用WKWebView上传图片时出错。

问题描述 投票:2回答:1

在一个 WKWebView 当我通过Ajax使用FormData向我们的服务器上传图片时,我收到了这个警告。整个过程成功完成。

有谁能建议是什么缺少的权利。 我已经审查了与以下相关的权利 WKWebView

在控制台中,我看到该 pid 与 "webkit.uploads "相关联。

"所需的客户端权限丢失 "requestReason: FinishTaskUnbounded; reason: FinishTaskUnbounded; flags: PreventTaskSuspend>

// xcode debug console on submit   
MyDomain[3002:428982] [ProcessSuspension]  0x104be68a0 - ProcessAssertion() PID 3002 Unable to acquire assertion for process with PID 3002
MyDomain[3002:427999] [ProcessSuspension] 0x104be68a0 - ProcessAssertion::processAssertionWasInvalidated()
MyDomain[3002:428982] [assertion] Error acquiring assertion: <NSError: 0x281b3b6f0; domain: RBSAssertionErrorDomain; code: 2; reason: "Required client entitlement is missing"> {
    userInfo = {
        RBSAssertionAttribute = <RBSLegacyAttribute: 0x100f2ee40; requestedReason: FinishTaskUnbounded; reason: FinishTaskUnbounded; flags: PreventTaskSuspend>;
    }
}


// javascript upload code
var formData=new FormData();
formData.append("action", 'save');

var fileInput = document.getElementById('addImage');
if (fileInput.files && fileInput.files[0]) {
    var file = fileInput.files[0
    formData.append('messageImage', file);
    hasFile = true;
}

if(hasFile){
    $.ajax({
       type: "POST",
       url: "/images/save",
       data: formData,
       dataType: 'json',
       contentType: false,
       processData: false,
       success: function(result){}
    });
}
ios swift iphone wkwebview entitlements
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.