Skip to content

😪 NativeScript plugin to keep the device awake (not dim the screen, lock, etc)

Notifications You must be signed in to change notification settings

bnussey/nativescript-insomnia

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NativeScript Insomnia

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

Note that version 1.2.0+ requires NativeScript 2.3.0+

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!");
  })

About

😪 NativeScript plugin to keep the device awake (not dim the screen, lock, etc)

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%