Use cordova-plugin-advanced-http

Ionic is supporting cordova-plugin-http with their @ionic-nativ/http lib, but there are some problems with the lib and there are other forks which works probably better

I tried to integrate the first plugin, installing it with ionic cordova plugin add cordova-plugin-advanced-http, the next thing I did is creating a plugin file as copied from ionic native on github and changed it to use new plugin, this is my example code

    pluginName: 'HTTP',
    plugin: 'cordova-plugin-advanced-http',
    pluginRef: 'cordovaHTTP',
    repo: '',
    platforms: ['Android', 'iOS']
export class HTTP extends IonicNativePlugin {

I changed plugin and repo property

But at the end in the emulator and on device I got this error:

Native: tried calling, but the HTTP plugin is not installed
Install the HTTP plugin: 'ionic cordova plugin add cordova-plugin-advanced-http’
But I had installed this before, so I’m really not the expert on cordova and plugins! :expressionless: Some ideas?

I already opened a feature request to support this from ionic team with ionic-native, feel free to vote for it :smile::smile:


This plugin registers a cordovaHTTP global on window


This plugin registers a global object located at cordova.plugin.http.


This plugin registers a global object located at cordova.plugin.http.

So these both use a different global object to put there functionality in than the original plugin, that is why the Ionic Native plugin doesn’t just work.

You will probably have to use them directly - or fix this.

1 Like

Does this mean that the Ionic Native wrapper for this wont work or that some additional configuration is needed?

I couldnt find the object on the window when I tested with the silkimen version?

Yes, the wrapper works only with the linked plugin if the other plugins are different in e.g. the object name they put into global JS namespace. This seems to be the case here.

Ionic Native now or better from a while is using this cordova plugin which works much better and is much better maintained!


I have successfully implemented certificate pinning with the help of this plugin.
Kindly help me regarding error coming most of the time i login. Login is inconsistent. Sometimes able to login but many times giving below errors
1)There was an error with the request: Failed to connect to “url”
2)The request is timeout

Kindly help me i am stuck in this and project cannot be successfull if this login inconsistency persist.

Does anyone face such issues. What can be the cause of this issue? Kindly enlighten in this subject.

To fix the issue of timeout i tried below IONIC forums links but not succeeded.

SSL Pinning example :sunglasses: