MyGit

nativescript-community/insomnia

Fork: 11 Star: 41 (更新于 2024-10-26 08:54:10)

license: 暂无

Language: JavaScript .

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

最后发布版本: v2.0.2 ( 2021-01-24 20:37:42)

GitHub网址

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

最近版本更新:(数据更新于 2024-10-23 10:11:52)

2021-01-24 20:37:42 v2.0.2

2021-01-05 18:06:27 v2.0.1

2020-09-16 15:21:02 2.0.0

2019-06-13 20:36:11 1.2.3

2018-09-03 02:42:43 1.2.2

2017-02-11 03:55:52 1.2.1

2016-09-23 17:46:00 1.2.0

2016-02-27 22:48:17 1.1.1

2015-07-12 17:44:03 1.1.0

主题(topics):

awake, dimming, insomnia, nativescript, nativescript-plugin, screen

nativescript-community/insomnia同语言 JavaScript最近更新仓库

2024-11-05 19:13:47 jerryc127/hexo-theme-butterfly

2024-11-05 13:53:42 LiteLoaderQQNT/LiteLoaderQQNT

2024-11-03 02:40:36 chris81605/Degrees-of-Lewdity_Cheat_Extended

2024-11-01 21:55:46 projectdiscovery/nuclei-templates

2024-11-01 19:24:44 NumberSir/DoL-I18n-Build

2024-11-01 12:25:14 midoks/mdserver-web