Skip to content

Latest commit

 

History

History
executable file
·
34 lines (24 loc) · 586 Bytes

README.md

File metadata and controls

executable file
·
34 lines (24 loc) · 586 Bytes

NativeScript Insomnia

A plugin to make the screen not dim (and eventually lock the device).

Installation

Run the following command from the root of your project:

tns plugin add nativescript-insomnia

Usage

To use this plugin you must first require() it:

var insomnia = require("nativescript-insomnia");

keepAwake

  insomnia.keepAwake().then(function() {
      console.log("Insomnia is active");
  })

allowSleepAgain

  insomnia.allowSleepAgain().then(function() {
      console.log("Insomnia is inactive, good night!");
  })