Has anyone used airwatch-sdk-plugin with ionic 2


#1

I define global variable
declare var window;

and then execute below in constructor of app.components.js but it does not do anything. I also encapsulated in try catch but simply did not get anything
window.plugins.airwatch.username(this.theFunction, this.theFunction);

theFunction(param){
this.alertCtrl.create({
title: ‘Airwatch’,
subTitle: param,
buttons: [‘Dismiss’]
}).present();
}


#2

I’d take a read of https://www.joshmorony.com/using-cordova-plugins-in-ionic-2-with-ionic-native/

Toward the bottom of the article, there’s info on incorporating 3rd party Cordova plugins that are not yet supported by Ionic Native.

Cordova plugins aren’t always available in the Browser (ionic serve). Check your developer console, as well written plugins will tell you they aren’t available or able to function.

If you’re linux or windows, install the Android SDK and use the emulator to do a real build (that will include the cordova plugin) and test there. (ionic run android --debug --livereload)

If you’re on Mac, use XCode to do the same thing.