7.0.0 • Published 12 months ago
@capacitor-community/keep-awake v7.0.0
Maintainers
| Maintainer | GitHub | Social |
|---|---|---|
| Kevin Boosten | kevinboosten | @kevinboosten |
| Robin Genz | robingenz | @robin_genz |
Installation
npm install @capacitor-community/keep-awake
npx cap syncConfiguration
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();
};
const isSupported = async () => {
const result = await KeepAwake.isSupported();
return result.isSupported;
};
const isKeptAwake = async () => {
const result = await KeepAwake.isKeptAwake();
return result.isKeptAwake;
};API
keepAwake()
keepAwake() => Promise<void>Prevent the device from dimming the screen.
allowSleep()
allowSleep() => Promise<void>Allow the device to dim the screen.
isSupported()
isSupported() => Promise<IsSupportedResult>Whether keep awake is supported or not.
Returns: Promise<IsSupportedResult>
isKeptAwake()
isKeptAwake() => Promise<IsKeptAwakeResult>Check if the device is kept awake.
Returns: Promise<IsKeptAwakeResult>
Interfaces
IsSupportedResult
| Prop | Type |
|---|---|
isSupported | boolean |
IsKeptAwakeResult
| Prop | Type |
|---|---|
isKeptAwake | boolean |
Changelog
See CHANGELOG.md.
License
See LICENSE.
6.0.0
12 months ago
5.0.1-dev.a09f5c3.1738003115
12 months ago
7.0.0
12 months ago
5.0.1
1 year ago
5.0.0
2 years ago
4.0.0
3 years ago
3.0.0-dev.a4d5a8d.1683032576
3 years ago
3.0.0-dev.4f57a55.1680890143
3 years ago
2.1.1-dev.0571a4c.1657740344
4 years ago
3.0.0
3 years ago
2.1.1-dev.1658320404
4 years ago
2.1.1-dev.0e7ebe7.1657739190
4 years ago
2.1.1-dev.1390021.1659192262
3 years ago
2.1.1
4 years ago
2.0.0-dev.bf88668
5 years ago
2.1.0
5 years ago
1.0.0-dev.057b74d.1618045916
5 years ago
1.0.0-dev.a9ce50d.1618046144
5 years ago
2.0.0
5 years ago
1.0.0
5 years ago