Skip to content

@capgo/capacitor-keep-awake

Prevent device screen from dimming or sleeping for video players, navigation, and presentations

Prevent device screen from dimming or sleeping for video players, navigation, and presentations

Start with keepAwake() and the other core methods listed below.

PlatformSupportNotes
iOSYesNative
AndroidYesNative
WebNoGuard with Capacitor.getPlatform()
  • 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.
MethodDescription
keepAwakePrevent the device from dimming the screen.
allowSleepAllow the device to dim the screen (disable keep awake).
isSupportedCheck if the keep awake feature is supported on the current platform.
isKeptAwakeCheck if the device is currently being kept awake.
getPluginVersionGet the native Capacitor plugin version.

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.