Skip to main content

Overview

Disables the screen wake lock, allowing the display to turn off normally according to the device’s sleep settings.

Returns

success
boolean
Promise resolving to true if the screen wake lock was disabled, false otherwise.

Platform Behavior

Important Notes

  • Always Disable: Call this method when you no longer need the screen to stay on to preserve battery.
  • Activity Required: On Android, this requires a current Activity. Returns false if no Activity is available.
  • Safe to Call: It’s safe to call this method even if screen wake lock wasn’t enabled.
  • Automatic Cleanup: The system automatically clears screen wake locks when the Activity is destroyed, but it’s good practice to disable manually.

Example Usage

Basic Usage

With Enable/Disable Pair

In useEffect Cleanup

Toggle Function