Search code examples
cordovaintel-xdkcrosswalk-runtime

How to prevent turn off a screen?


I would like to don't turn off a screen after specific time of inactivity in my intel xdk application if user is in a given function. It would be also fine if the whole application wouldn't agree to turn off. Is it possible?


Solution

  • Try with insomnia plugin

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