CORS issue on real device

I’ve added proxy in ionic.config.json and also checked platform and based on my platform am changing API url but seems CORS issue is not fixed for me.


  "name": "eppm",
  "app_id": "",
  "type": "ionic-angular",
  "integrations": {
    "cordova": {}
  "proxies": [
      "path": "/path",
      "proxyUrl": "http://domain/path"


import { Platform } from 'ionic-angular';
export class ApiManagerProvider {
constructor(private platform: Platform, public http: HttpClient, private cManager: CookieManagerProvider) { }
 private makePostRequest(command: string, data: any) {

    if('core') ||'mobileweb')) {
      url = 'pace/rest/3.0/eppm/cmd/';
    else {
      url = '';

    let apiHeader = new HttpHeaders();
    let contentType = apiHeader.set('Content-Type', 'application/x-www-form-urlencoded');
    let pace = contentType.append('pace-useragent', 'rest');

    let param = new URLSearchParams();
    for (var key in data) {
      param.append(key, data[key]);

    return new Promise((resolve, reject) => { + command, param.toString(), { headers: pace, withCredentials: true }).subscribe(res => {
      }, (error: HttpErrorResponse) => {


<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />

Note: I’m running this app on development mode.

Kindly help me to figure this out guys.
Thanks in advance.

It is usually your API server that’s refusing your connection. What is your API server? PHP?

@cedrickd APIs were build on Java platform.

Hi @hardikajmeri Same problem here. Could you solve the issue?


You need to fix the issue in the backend, not in Ionic.

Hello @pablocettour, I’ve came across with the following solutions:

  1. For Web Apps, user angular’s http client
  2. For Mobile App, use cordova plugin http plugin

Even after implementing above if you still faces any issues then you need to fix the same in backend.

I am facing the same after upgrading fron UIWebview to WK

in my server is fully granted with cors orgin

but still i am getting refused