Hello everybody,
I spent the last 3 days trying to fix this issue, but with no results
I am using Ionic 1, the app is running on android very well, the issue in iOS, the app start normal and every thing is ok until I open a page with $http.get request, it gives me this error in safari console:
- Origin http://localhost:8080 is not allowed by Access-Control-Allow-Origin.
- Failed to load resource: Origin http://localhost:8080 is not allowed by Access--
Control-Allow-Origin.
XMLHttpRequest cannot load http://example.com/Step/getByProcedureID?procedureID=15&ID=0 due to access control checks.
Ionic Environment:
$ ionic info
cli packages: (/usr/local/lib/node_modules)
@ionic/cli-utils : 1.12.0
ionic (Ionic CLI) : 3.12.0
global packages:
cordova (Cordova CLI) : 7.0.1
Gulp CLI : CLI version 3.9.1 Local version 3.9.1
local packages:
Cordova Platforms : ios 4.4.0
Ionic Framework : ionic1 1.3.3
System:
ios-deploy : 1.9.2
ios-sim : 6.1.2
Node : v6.11.3
npm : 3.10.10
OS : macOS Sierra
Xcode : Xcode 9.0 Build version 9A235
Note:
Also I check that these tags are in the config.xml
<access origin="*" />
<allow-navigation href="http://example.com/*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
And adding this to my index.html:
<meta http-equiv="Content-Security-Policy" content="default-src gap://ready file://* *; script-src 'self' 'unsafe-inline' 'unsafe-eval' *; style-src 'self' 'unsafe-inline' ">
Installed Plugins:
<plugin name="cordova-plugin-camera" spec="~2.4.1" />
<plugin name="cordova-plugin-device" spec="1.1.4" />
<plugin name="cordova-plugin-email-composer" spec="~0.8.10" />
<plugin name="cordova-plugin-file" spec="~4.3.3" />
<plugin name="cordova-plugin-file-transfer" spec="~1.6.3" />
<plugin name="cordova-plugin-google-analytics" spec="~1.8.3" />
<plugin name="cordova-plugin-googlemaps" spec="git+https://github.com/mapsplugin/cordova-plugin-googlemaps.git">
<variable name="API_KEY_FOR_IOS" value="MYAPIKEY" />
</plugin>
<plugin name="cordova-plugin-inappbrowser" spec="~1.7.1" />
<plugin name="cordova-plugin-ionic-webview" spec="^1.1.9" />
<plugin name="cordova-plugin-network-information" spec="~1.3.3" />
<plugin name="cordova-plugin-splashscreen" spec="~4.0.1" />
<plugin name="cordova-plugin-statusbar" spec="git+https://github.com/apache/cordova-plugin-statusbar.git" />
<plugin name="cordova-plugin-whitelist" spec="^1.3.2" />
<plugin name="cordova-plugin-x-socialsharing" spec="~5.1.8" />
<plugin name="ionic-plugin-keyboard" spec="~2.2.1" />
I faced this problem but in browser, but never faced it on iOS Device, and still happening on the Simulator and on iPhone (iOS Devices).
Help please, thanks in advance