# Ionic 3 CORS problem(WebView?)

**URL:** <https://forum.ionicframework.com/t/ionic-3-cors-problem-webview/176456>\
**Category:** Ionic Framework\
**Created:** [October 28, 2019, 7:05pm UTC](https://forum.ionicframework.com/t/ionic-3-cors-problem-webview/176456 "2019-10-28T19:05:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![prre](https://avatars.discourse-cdn.com/v4/letter/p/51bf81/32.png) [@prre](https://forum.ionicframework.com/u/prre)\
**Post date:** [October 28, 2019, 7:05pm UTC](https://forum.ionicframework.com/t/ionic-3-cors-problem-webview/176456/1 "2019-10-28T19:05:45Z")

</div>

Hi, I started making my second Ionic App and have some problems with CORS.

My Settings:

@ionic/cli-utils : 1.19.2  
ionic (Ionic CLI) : 3.20.0  
global packages:

```
cordova (Cordova CLI) : 8.0.1-nightly.2018.4.24.aeb1ddbc (cordova-lib@8.0.1-nightly.2018.4.24.fc69a0bd)

```

local packages:

```
@ionic/app-scripts : 3.2.2
Cordova Platforms : Warning: using prerelease version 8.0.1-nightly.2018.4.24.aeb1ddbc (cordova-lib@8.0.1-nightly.2018.4.24.fc69a0bd) android 8.1.0
Ionic Framework : ionic-angular 3.9.5

```

System:

```
Node : v9.11.2
npm : 5.6.0
OS : Windows 10

```

“dependencies”: {  
“@angular/animations”: “5.2.11”,  
“@angular/common”: “5.2.11”,  
“@angular/compiler”: “5.2.11”,  
“@angular/compiler-cli”: “5.2.11”,  
“@angular/core”: “5.2.11”,  
“@angular/forms”: “5.2.11”,  
“@angular/http”: “5.2.11”,  
“@angular/platform-browser”: “5.2.11”,  
“@angular/platform-browser-dynamic”: “5.2.11”,  
“@ionic-native/camera”: “^4.2.0”,  
“@ionic-native/core”: “~4.20.0”,  
“@ionic-native/http”: “^5.15.1”,  
“@ionic-native/native-storage”: “^4.5.2”,  
“@ionic-native/network”: “^4.11.0”,  
“@ionic-native/splash-screen”: “~4.20.0”,  
“@ionic-native/status-bar”: “~4.20.0”,  
“@ionic/storage”: “2.2.0”,  
“cordova-android”: “8.1.0”,  
“cordova-plugin-advanced-http”: “^1.11.0”,  
“cordova-plugin-camera”: “4.1.0”,  
“cordova-plugin-file”: “^6.0.2”,  
“cordova-plugin-nativestorage”: “2.3.2”,  
“cordova-plugin-network-information”: “2.0.2”,  
“ionic-angular”: “3.9.5”,  
“ionic-img-viewer”: “^2.9.0”,  
“ionicons”: “3.0.0”,  
“rxjs”: “5.5.11”,  
“sw-toolbox”: “3.6.0”,  
“zone.js”: “0.8.29”  
},  
“devDependencies”: {  
“@ionic/app-scripts”: “3.2.2”,  
“cordova-plugin-device”: “^2.0.2”,  
“cordova-plugin-ionic-keyboard”: “^2.2.0”,  
“cordova-plugin-ionic-webview”: “^4.1.2”,  
“cordova-plugin-splashscreen”: “^5.0.2”,  
“cordova-plugin-statusbar”: “^2.4.2”,  
“cordova-plugin-whitelist”: “^1.3.3”,  
“typescript”: “~2.6.2”  
},  
“description”: “An Ionic project”,  
“cordova”: {  
“plugins”: {  
“cordova-plugin-camera”: {},  
“cordova-plugin-network-information”: {},  
“cordova-plugin-nativestorage”: {},  
“cordova-plugin-whitelist”: {},  
“cordova-plugin-statusbar”: {},  
“cordova-plugin-device”: {},  
“cordova-plugin-splashscreen”: {},  
“cordova-plugin-ionic-webview”: {  
“ANDROID\_SUPPORT\_ANNOTATIONS\_VERSION”: “27.+”  
},  
“cordova-plugin-ionic-keyboard”: {},  
“cordova-plugin-advanced-http”: {}  
},  
“platforms”: [  
“android”  
]

So the Problem is that I want to make some GET/POST Request to my API. The API/Server accept the POST request and put the data to my MySQL but I get no respons.  
On browser(ionic serve) it work how it should but If I build the app on real Device and use the Crome Developement debugger I always get this issues:

Access to XMLHttpRequest at ‘[https://m.domain.de/app/api2/login](https://m.domain.de/app/api2/login)’ from origin ‘[http://192.168.2.120:8100](http://192.168.2.120:8100)’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

My first App make the same GET/POST request to the same Server and API and there are no Problems.

Older App:

“dependencies”: {  
“@angular/common”: “5.0.3”,  
“@angular/compiler”: “5.0.3”,  
“@angular/compiler-cli”: “5.0.3”,  
“@angular/core”: “5.0.3”,  
“@angular/forms”: “5.0.3”,  
“@angular/http”: “5.0.3”,  
“@angular/platform-browser”: “5.0.3”,  
“@angular/platform-browser-dynamic”: “5.0.3”,  
“@ionic-native/camera”: “^4.11.0”,  
“@ionic-native/core”: “4.4.0”,  
“@ionic-native/device”: “^4.5.2”,  
“@ionic-native/geolocation”: “^4.7.0”,  
“@ionic-native/native-storage”: “^4.5.2”,  
“@ionic-native/network”: “^4.11.0”,  
“@ionic-native/splash-screen”: “4.4.0”,  
“@ionic-native/status-bar”: “4.4.0”,  
“@ionic/storage”: “2.1.3”,  
“com.wikitude.phonegap.wikitudeplugin”: “git+https://github.com/Wikitude/wikitude-cordova-plugin.git”,  
“cordova-android”: “6.3.0”,  
“cordova-browser”: “5.0.3”,  
“cordova-ios”: “4.5.4”,  
“cordova-plugin-camera”: “^4.0.3”,  
“cordova-plugin-device”: “^1.1.4”,  
“cordova-plugin-geolocation”: “^4.0.1”,  
“cordova-plugin-ionic-webview”: “^1.1.16”,  
“cordova-plugin-nativestorage”: “^2.2.2”,  
“cordova-plugin-network-information”: “^2.0.1”,  
“cordova-plugin-splashscreen”: “^4.0.3”,  
“cordova-plugin-whitelist”: “^1.3.1”,  
“ionic-angular”: “3.9.2”,  
“ionic-img-viewer”: “^2.9.0”,  
“ionic-plugin-keyboard”: “^2.2.1”,  
“ionicons”: “3.0.0”,  
“leaflet”: “^1.3.3”,  
“rxjs”: “5.5.2”,  
“sw-toolbox”: “3.6.0”,  
“zone.js”: “0.8.18”  
},  
“devDependencies”: {  
“@ionic/app-scripts”: “3.1.11”,  
“@ionic/lab”: “1.0.2”,  
“typescript”: “2.4.2”  
},  
“description”: “An Ionic project”,  
“cordova”: {  
“plugins”: {  
“cordova-plugin-device”: {},  
“ionic-plugin-keyboard”: {},  
“cordova-plugin-whitelist”: {},  
“cordova-plugin-splashscreen”: {},  
“cordova-plugin-ionic-webview”: {},  
“cordova-plugin-nativestorage”: {},  
“cordova-plugin-geolocation”: {},  
“cordova-plugin-network-information”: {},  
“cordova-plugin-camera”: {}  
},  
“platforms”: [  
“android”,  
“ios”,  
“browser”

I think the problem isn’t my API or Server, I think that my WebView not accept the respons from my server?  
Thanks for your help!!

---

<div class="post-metadata">

**Author:** ![sonicwong](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@sonicwong](https://forum.ionicframework.com/u/sonicwong)\
**Post date:** [October 29, 2019, 2:59am UTC](https://forum.ionicframework.com/t/ionic-3-cors-problem-webview/176456/2 "2019-10-29T02:59:14Z")

</div>

did you try this?

> **[Ionic Framework](https://ionicframework.com/docs/v3/cli/configuring.html#service-proxies)**
>
> Ionic is the app platform for web developers. Build amazing mobile, web, and desktop apps all with one shared code base and open web standards
