Integrating third party cordova plugins and using in ionic


How to integrate cordova plugins for example appnext-plugin and how to use the functionalities of the plugin in ionic please help me

How to make a native wrapper for cordova plugin that uses javascript

You must first add plugin to project. Find the plugin at url. If plugin doesn’t exist, you must follow different approach.

  • Add cordova plugin:
cordova plugin add xxx
  • Declare any in component.ts file.
declare let cordova: any;
  • Use javascript functions.


import { Component, OnInit } from '@angular/core';
import { NavController } from 'ionic-angular';

declare let cordova: any;

  selector: 'page-contact',
  templateUrl: 'contact.html'
export class ContactPage implements OnInit {

  constructor(public navCtrl: NavController) {





oh thanks let me try that


I tried declare var cordova:any; but it doesnt work for me is there any alternative


You’ll need to access the plugin’s functionality through the plugins namespace on window object like this:


This is my preferred way to use it. If you don’t want to use < any> everytime, you can first use this line above the @Component decorator:

declare var window;

and then use


UPDATE: If the above line does not work, please try window.pluginName.pluginMethod()

For further insights, you can refer to the last topic “Using a Plugin Not Included in Ionic Native” on Using non-ionic-native plugins in ionic 2+ blog by joshmorony. Hope this solves your problem. Please reach our for any further assistance. Cheers!