How to use a Cordova plugin in my Ionic 3?

Asked

Viewed 90 times

0

I need to implement in my application the following Ionic plugin:

https://github.com/boltex/cordova-plugin-powermanagement&xid=17259,15700019,15700124,15700149,15700186,15700191,15700201,15700214,15700230&usg=ALkJrhg2u9afy7Kktp6dTGNpjb2uPGlDvA

But I can’t call it in my file.

I tried something like:

window.plugins.powerManagement();

but I get:

Property plugins does not exist on type "Window"

Is there any way I can access this plugin?

I’ve already added it through:

cordova plugin add https://github.com/boltex/cordova-plugin-powermanagement.git

But, what now?

2 answers

0

For those interested, I was able to access the properties of this plugin through the following way:

  (<any>window).powerManagement.dim();
  (<any>window).powerManagement.setReleaseOnPause(false)

-1

The Cordova plugins are only accessed through a device... That is, if you are testing through the browser it will not be possible to access it..

In the documentation search on the property ready I believe it will solve your problem.

  • Not what I needed.

  • I’ve got it, answered my own question

Browser other questions tagged

You are not signed in. Login or sign up in order to post.