@capacitor-community/keep-awake
⚡️ Capacitor plugin to prevent devices from dimming or locking the screen.
Maintainer | GitHub | Social |
---|---|---|
Kevin Boosten | kevinboosten | @kevinboosten |
Robin Genz | robingenz | @robin_genz |
npm install @capacitor-community/keep-awake
npx cap sync
No configuration required for this plugin.
A working example can be found here: robingenz/capacitor-plugin-demo
import { KeepAwake } from '@capacitor-community/keep-awake';
const keepAwake = async () => {
await KeepAwake.keepAwake();
};
const allowSleep = async () => {
await KeepAwake.allowSleep();
};
keepAwake() => Promise<void>
Prevent the device from dimming the screen.
allowSleep() => Promise<void>
Allow the device to dim the screen.
See CHANGELOG.md.
See LICENSE.