Keep Screen On

Prevent the device screen from automatically locking or dimming while users are in your app

The Keep Screen On JavaScript Bridge method lets you override the device's default screen-lock/timeout behavior so the screen stays awake while your app is in the foreground. It's part of Median's Device Screen Control feature set, alongside Screen Brightness and Full Screen.

👍

Developer Demo

Display our demo page in your app to test during development https://median.dev/device-screen-controls/

Why Use Keep Screen On

  • Navigation and map apps: Keep turn-by-turn directions or live tracking visible on screen during a trip, without users having to keep tapping to wake the device.
  • Presentation and kiosk displays: Hold a screen awake indefinitely for signage, in-store kiosks, or presentation mode where no one is actively touching the device.
  • QR code and barcode display: Keep a boarding pass, ticket, or payment QR code visible long enough to be scanned, even if the user pauses before presenting it.
  • Fitness and workout sessions: Keep workout timers, stats, or instructional content visible throughout an active session without the screen dimming or locking.

Implementation Guide

JavaScript Bridge Implementation

Enable Keep Screen On

Prevents the device screen from locking or dimming while your app is active.

median.screen.keepScreenOn();

Disable Keep Screen On

Returns the screen to the device's normal lock/timeout behavior.

median.screen.keepScreenNormal();