2.0.0 • Published 4 years ago

nativescript-insomnia v2.0.0

Weekly downloads
139
License
MIT
Repository
github
Last release
4 years ago

NativeScript Insomnia

NPM version Downloads Twitter Follow

💡 Plugin version 2.0.0+ is compatible with NativeScript 7+. If you need to target older NativeScript versions, please stick to plugin version 1.2.3.

Demo app (Angular)

This plugin is part of the plugin showcase app I built using Angular.

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:

JavaScript

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

TypeScript

You could do the same as in JS, but this looks fancier, right?

import { keepAwake, allowSleepAgain } from "nativescript-insomnia";

keepAwake

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

allowSleepAgain

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

4 years ago

1.2.3

5 years ago

1.2.2

6 years ago

1.2.1

7 years ago

1.2.0

8 years ago

1.1.1

8 years ago

1.1.0

9 years ago

1.0.0

9 years ago