@capgo/capacitor-keep-awake
Overview
Section titled “Overview”Prevent device screen from dimming or sleeping for video players, navigation, and presentations
Start with keepAwake() and the other core methods listed below.
Platform support
Section titled “Platform support”| Platform | Support | Notes |
|---|---|---|
| iOS | Yes | Native |
| Android | Yes | Native |
| Web | No | Guard with Capacitor.getPlatform() |
Core Capabilities
Section titled “Core Capabilities”keepAwake- Prevent the device from dimming the screen.allowSleep- Allow the device to dim the screen (disable keep awake).isSupported- Check if the keep awake feature is supported on the current platform.isKeptAwake- Check if the device is currently being kept awake.
Public API
Section titled “Public API”| Method | Description |
|---|---|
keepAwake | Prevent the device from dimming the screen. |
allowSleep | Allow the device to dim the screen (disable keep awake). |
isSupported | Check if the keep awake feature is supported on the current platform. |
isKeptAwake | Check if the device is currently being kept awake. |
getPluginVersion | Get the native Capacitor plugin version. |
Source Of Truth
Section titled “Source Of Truth”This reference is synced from src/definitions.ts in capacitor-keep-awake.
Keep going from @capgo/capacitor-keep-awake
Section titled “Keep going from @capgo/capacitor-keep-awake”If you are using @capgo/capacitor-keep-awake to plan native media and interface behavior, connect it with Using @capgo/capacitor-keep-awake for the native capability in Using @capgo/capacitor-keep-awake, Using @capgo/capacitor-live-activities for the native capability in Using @capgo/capacitor-live-activities, @capgo/capacitor-live-activities for the implementation detail in @capgo/capacitor-live-activities, Using @capgo/capacitor-video-player for the native capability in Using @capgo/capacitor-video-player, and @capgo/capacitor-video-player for the implementation detail in @capgo/capacitor-video-player.