Cordova Tips: jQuery get (AJAX) not working and CORS Policy problem on iOS? Here is the solution

I’ve been struggling on building an iOS web app using Cordova, because whatever I did, the web app can not run jQuery get function because of CORS Policy problem in iOS WebKit WebView.

Before Apple forced us to use WKWebView there were no problem at all.

Okay, the solution is, add these lines in your project config.xml file:

<access origin="*" />
<allow-navigation href="*"/>
<preference name="scheme" value="app" />
<preference name="hostname" value="localhost" />

Leave a Reply

Your email address will not be published. Required fields are marked *