I upgraded an existing application to Cordova 6.0.0, and I have problems running it on an iOS device with Xcode 7.2.1 oriented to iOS 9.
I installed the WKWebView plugin: cordova-plugin-wkwebview-engine 1.0.2
When starting an application that is built using AngularJS, one of the first things he tries to do is open the json file:
$http.get('data/config.json').success(function(data) {
But we get this error in the web view console:
XMLHttpRequest cannot load file:///var/mobile/Containers/Bundle/Application/ E9D74C94-ADC6-410F-9F41-7CE63CB7877F/Milk.app/www/data/config.json. Cross origin requests are only supported for HTTP.
In the config.xml file we have:
<access origin="*" subdomains="true" />
Why is the file: // request blocked, and how can I fix it?
* edit *
According to the plugin :
"In iOS 9, Apple fixed an issue that existed through iOS 8, where you cannot upload locale files using the file: //, and resort to using the local web server. However, you still cannot use XHR from the file: // protocol without CORS enabled on your server. "
What do they mean by "your server"? Which server? We upload a local file, no server!
source share