Closed emandev1988 closed 6 years ago
Hi @emandev1988,
See here: https://www.joshmorony.com/using-cordova-plugins-in-ionic-2-with-ionic-native/
Look at this section: Using a Plugin Not Included in Ionic Native
Can you try this:
(<any>window).cordova.plugins.CipherlabRS30CordovaPlugin.initialise();
or
declare var cordova: any;
//instead of declare let cordova: any;
Using
declare var cordova: any;
works.
Hi, I am struggling to use this plugin with ionic 3 (typescript)
Here is my code:
//import * as Scanner from 'cordova-plugin-cipherlab-rs30; import { Component } from '@angular/core'; import { IonicPage, NavController, NavParams } from 'ionic-angular';
declare let cordova: any;
@IonicPage() @Component({ selector: 'page-iss', templateUrl: 'iss.html', })
export class IssPage {
//declare var cordova; constructor(public navCtrl: NavController, public navParams: NavParams) { cordova.plugins.CipherlabRS30CordovaPlugin.initialise(); }
}
when running on actual cipher lab device i get the following error:
vendor.js:1823 ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'CipherlabRS30CordovaPlugin' of undefined TypeError: Cannot read property 'CipherlabRS30CordovaPlugin' of undefined at new IssPage (main.js:804) at createClass (vendor.js:12857) at createDirectiveInstance (vendor.js:12700) at createViewNodes (vendor.js:14158) at createRootView (vendor.js:14047) at callWithDebugContext (vendor.js:15472) at Object.debugCreateRootView [as createRootView] (vendor.js:14755) at ComponentFactory_.create (vendor.js:11652) at ComponentFactoryBoundToModule.create (vendor.js:4404) at NavControllerBase.viewInit (vendor.js:51939) at new IssPage (main.js:804) at createClass (vendor.js:12857) at createDirectiveInstance (vendor.js:12700) at createViewNodes (vendor.js:14158) at createRootView (vendor.js:14047) at callWithDebugContext (vendor.js:15472) at Object.debugCreateRootView [as createRootView] (vendor.js:14755) at ComponentFactory.create (vendor.js:11652) at ComponentFactoryBoundToModule.create (vendor.js:4404) at NavControllerBase._viewInit (vendor.js:51939) at c (polyfills.js:3) at Object.reject (polyfills.js:3) at NavControllerBase._fireError (vendor.js:51721) at NavControllerBase._failed (vendor.js:51714) at vendor.js:51761 at t.invoke (polyfills.js:3) at Object.onInvoke (vendor.js:5134) at t.invoke (polyfills.js:3) at r.run (polyfills.js:3) at polyfills.js:3
Please assist,