Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Cordova Insomnia plugin - Keep the screen awake

    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 3.04k
    Comment on it

    Hello readers,

    This post is about cordova insomnia plugin. Which prevent the mobile screen from turn down and locking while user is not touching the screen.

    This feature used in applications when we read a lengthy document or watching a video in application. To use this feature in the app we need to install following plugin through CLI :

    $ cordova plugin add https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin.git

    and then

    $ cordova prepare

    This plugin supports Android, iOS, Windows and wp8 applications.

    To keeping your app awake call the following method:

    <button onclick="window.plugins.insomnia.keepAwake()">keep awake</button>

    You can allow your device to falling asleep using below method:

    <button onclick="window.plugins.insomnia.allowSleepAgain()">allow sleep again</button>

    This method allows device to turn down.

    Hope this will help you... :)

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: