Skip to content

⚡️ Capacitor plugin to prevent devices from dimming or locking the screen.

License

Notifications You must be signed in to change notification settings

michaeltintiuc/keep-awake

 
 

Repository files navigation


Keep Awake

@capacitor-community/keep-awake

⚡️ Capacitor plugin to prevent devices from dimming or locking the screen.


Maintainers

Maintainer GitHub Social
Kevin Boosten kevinboosten @kevinboosten
Robin Genz robingenz @robin_genz

Installation

npm install @capacitor-community/keep-awake
npx cap sync

Configuration

No configuration required for this plugin.

Demo

A working example can be found here: robingenz/capacitor-plugin-demo

Usage

import { KeepAwake } from '@capacitor-community/keep-awake';

const keepAwake = async () => {
  await KeepAwake.keepAwake();
};

const allowSleep = async () => {
  await KeepAwake.allowSleep();
};

API

keepAwake()

keepAwake() => Promise<void>

Prevent the device from dimming the screen.


allowSleep()

allowSleep() => Promise<void>

Allow the device to dim the screen.


Changelog

See CHANGELOG.md.

License

See LICENSE.

About

⚡️ Capacitor plugin to prevent devices from dimming or locking the screen.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 33.4%
  • Swift 20.5%
  • TypeScript 18.1%
  • Ruby 12.4%
  • Objective-C 9.5%
  • JavaScript 6.1%