nativescript-community / insomnia

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

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to insomnia

nativescript-ng-shadow
Angular directive to apply shadows to native elements according to the elevation level guidelines of material design specification
Stars: ✭ 54 (+35%)
Mutual labels:  nativescript, nativescript-plugin
nativescript-menu
A plugin that adds a pop-up menu to NativeScript
Stars: ✭ 17 (-57.5%)
Mutual labels:  nativescript, nativescript-plugin
nativescript-image-filters
NativeScript plugin to apply filters to images
Stars: ✭ 30 (-25%)
Mutual labels:  nativescript, nativescript-plugin
nativescript-appversion
🔢 NativeScript plugin to retrieve your app's package ID and current version
Stars: ✭ 47 (+17.5%)
Mutual labels:  nativescript, nativescript-plugin
nativescript-taptic-engine
📳 Use Apple's Taptic Engine to vibrate your iPhone 6s (and up) in a variety of ways
Stars: ✭ 16 (-60%)
Mutual labels:  nativescript, nativescript-plugin
Nativescript Vue
Native mobile applications using Vue and NativeScript.
Stars: ✭ 4,784 (+11860%)
Mutual labels:  nativescript, nativescript-plugin
nativescript-star-printer
🌟 Print directly to Star Micronics printers from your NativeScript app! http://www.starmicronics.com/
Stars: ✭ 28 (-30%)
Mutual labels:  nativescript, nativescript-plugin
nativescript-performance-monitor
⚡ Proof your app maintains 60-ish FPS by collecting data or showing it on screen with this NativeScript plugin!
Stars: ✭ 21 (-47.5%)
Mutual labels:  nativescript, nativescript-plugin
nativescript-pushy
Easy push notifications for your NativeScript app!
Stars: ✭ 19 (-52.5%)
Mutual labels:  nativescript, nativescript-plugin
nativescript-app-icon-changer
Change the homescreen icon of your NativeScript iOS app at runtime!
Stars: ✭ 16 (-60%)
Mutual labels:  nativescript, nativescript-plugin
nativescript-homekit
🏡 HomeKit plugin for your fancy NativeScript app
Stars: ✭ 23 (-42.5%)
Mutual labels:  nativescript, nativescript-plugin
nativescript-clipboard
📋 NativeScript plugin to copy stuff to the device clipboard, and read from it again
Stars: ✭ 40 (+0%)
Mutual labels:  nativescript, nativescript-plugin
nativescript-vue-multi-drawer
A NativeScript-Vue component for creating multiple side drawers (4 sides supported)
Stars: ✭ 45 (+12.5%)
Mutual labels:  nativescript, nativescript-plugin
nativescript-store-update
No description or website provided.
Stars: ✭ 18 (-55%)
Mutual labels:  nativescript, nativescript-plugin
nativescript-printer
📠 Send an image or the screen contents to a physical printer
Stars: ✭ 33 (-17.5%)
Mutual labels:  nativescript, nativescript-plugin
texttospeech
Text to Speech NativeScript plugin for Android & iOS 📢
Stars: ✭ 44 (+10%)
Mutual labels:  nativescript, nativescript-plugin
ui
Add right-to-left support to the NativeScript framework
Stars: ✭ 22 (-45%)
Mutual labels:  nativescript, nativescript-plugin
nativescript-http
The best way to do HTTP requests in NativeScript, a drop-in replacement for the core HTTP with important improvements and additions like proper connection pooling, form data support and certificate pinning
Stars: ✭ 32 (-20%)
Mutual labels:  nativescript, nativescript-plugin
nativescript-apple-sign-in
Sign In With Apple, as seen on WWDC 2019, available with iOS 13
Stars: ✭ 37 (-7.5%)
Mutual labels:  nativescript, nativescript-plugin
nativescript-vue-examples
🍈 NativeScript and Vue code samples.
Stars: ✭ 13 (-67.5%)
Mutual labels:  nativescript, nativescript-plugin

NativeScript Insomnia

💡 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-community/insomnia

Usage

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

JavaScript

var insomnia = require("@nativescript-community/insomnia");

TypeScript

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

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

keepAwake

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

allowSleepAgain

  insomnia.allowSleepAgain().then(function() {
      console.log("Insomnia is inactive, good night!");
  })
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].