Insomnia
:sleepy: NativeScript plugin to keep the device awake (not dim the screen, lock, etc)
Install / Use
/learn @nativescript-community/InsomniaREADME
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!");
})
Related Skills
node-connect
346.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
346.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
346.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
