PowerManagement Plugin

4 posts, 1 answers
  1. Loren
    Loren avatar
    9 posts
    Member since:
    Dec 2013

    Posted 18 Apr 2014 Link to this post

    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' ); }
     );

  2. Answer
    Iva Koevska
    Admin
    Iva Koevska avatar
    286 posts

    Posted 21 Apr 2014 Link to this post

    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!

     
  3. Loren
    Loren avatar
    9 posts
    Member since:
    Dec 2013

    Posted 21 Apr 2014 in reply to Iva Koevska Link to this post

    Its not working.

    I have an alert and it only shows {} for the window.powerManagement object
  4. Loren
    Loren avatar
    9 posts
    Member since:
    Dec 2013

    Posted 21 Apr 2014 in reply to Loren Link to this post

    Nevermind i found the issue
Back to Top