This is a migrated thread and some comments may be shown as answers.

PowerManagement Plugin

3 Answers 56 Views
General Discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Loren
Top achievements
Rank 1
Loren asked on 18 Apr 2014, 04:26 PM
Hi,

I downloaded the latest version of PowerManagement Plugin from here (https://github.com/Viras-/cordova-plugin-powermanagement)

I imported it into the AppBuilder and according to AppBuilder documentation since the plugin.xml uses js-modules i dont need to declare it in the index.html.

However, i can figure out how to use it i tried this to no avail when i run this on the device. Please help

cordova.require('cordova/plugin/powermanagement').acquire(
    function() { alert( 'successfully acquired full wake lock' ); },
    function() { alert( 'error acquiring full wake lock' ); }
 );

3 Answers, 1 is accepted

Sort by
0
Accepted
Iva Koevska
Telerik team
answered on 21 Apr 2014, 09:27 AM
Hi Loren,

You should call the plugin using the clobbers target set in plugin.xml. In this case, calling the plugin should be done via window.powerManagement.acquire, windows.powerManagement.release, and window.powerManagement.dim.

I have attached a sample project that uses acquire and release.

Regards,
Iva Koevska
Telerik
 

Share what you think about AppBuilder and Telerik Platform with us in our feedback portal, so we can become even better!

 
0
Loren
Top achievements
Rank 1
answered on 21 Apr 2014, 09:15 PM
Its not working.

I have an alert and it only shows {} for the window.powerManagement object
0
Loren
Top achievements
Rank 1
answered on 21 Apr 2014, 09:15 PM
Nevermind i found the issue
Tags
General Discussion
Asked by
Loren
Top achievements
Rank 1
Answers by
Iva Koevska
Telerik team
Loren
Top achievements
Rank 1
Share this question
or