5.0.0 • Published 24 days ago
@capacitor-community/keep-awake v5.0.0
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();
};
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.
5.0.0
24 days ago
4.0.0
1 year ago
3.0.0-dev.a4d5a8d.1683032576
1 year ago
3.0.0-dev.4f57a55.1680890143
1 year ago
2.1.1-dev.0571a4c.1657740344
2 years ago
3.0.0
2 years ago
2.1.1-dev.1658320404
2 years ago
2.1.1-dev.0e7ebe7.1657739190
2 years ago
2.1.1-dev.1390021.1659192262
2 years ago
2.1.1
2 years ago
2.0.0-dev.bf88668
3 years ago
2.1.0
3 years ago
1.0.0-dev.057b74d.1618045916
3 years ago
1.0.0-dev.a9ce50d.1618046144
3 years ago
2.0.0
3 years ago
1.0.0
4 years ago