Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/112.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Cordova 10.0 Ajax在iOS 14中不工作,但在Android中工作良好_Ios_Ajax_Cordova - Fatal编程技术网

Cordova 10.0 Ajax在iOS 14中不工作,但在Android中工作良好

Cordova 10.0 Ajax在iOS 14中不工作,但在Android中工作良好,ios,ajax,cordova,Ios,Ajax,Cordova,我最近将我的Xcode更新为12.0,我的mac上有最新的iOS 14和Cordova 10.0.0。我还将UIWebview更改为wkwebview-only 我还参考了以下链接以启用配置文件中的选项: 我的配置文件如下所示 <access origin="*" /> <allow-intent href="http://*/*" /> <allow-intent href="https://*/*"

我最近将我的Xcode更新为12.0,我的mac上有最新的iOS 14和Cordova 10.0.0。我还将
UIWebview
更改为
wkwebview-only
我还参考了以下链接以启用配置文件中的选项:

我的配置文件如下所示

<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" /> 
<platform name="ios">
    <allow-intent href="itms:*" />
    <allow-intent href="itms-apps:*" />
<preference name="AllowUntrustedCerts" value="on" />
<preference name="InterceptRemoteRequests" value="all" />
<preference name="NativeXHRLogging" value="full" />
<preference name="WKWebViewOnly" value="true" />
    <feature name="CDVWKWebViewEngine">
        <param name="ios-package" value="CDVWKWebViewEngine" />
    </feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
</platform>
我还尝试将以下内容添加到index.html

<meta http-equiv="Content-Security-Policy" content="connect-src *; style-src 'self' 'unsafe-inline'; media-src *">


我假设Cordova可以很好地运行Ajax,事实上,在我的旧版本Cordova和Xcode中,它运行得很好,但最近我遇到了这个问题。

请添加跨域:适用于您的Ajax args

嗨,Sam,您找到解决方案了吗?我还没有在ios14上尝试我的Cordova应用程序,但这个问题让我很害怕。还没有运气,正在等待尽快解决。嗨!很有可能与CORS相关的事情正在那里发生,因为WKWebView强制要求每个请愿书都通过跨来源验证。如果您正在访问某个您没有权限访问的远程url(CORS策略阻止您的请求),则会发生该错误。如果是您的问题(您可以在iOS模拟器上检查它,打开safari并检查开发人员控制台);您应该请求在该域上启用CORS,或者使用一些本机插件进行请求(如所示)
<meta http-equiv="Content-Security-Policy" content="connect-src *; style-src 'self' 'unsafe-inline'; media-src *">