How to Keep the Screen Awake in Your Expo App

DavidDavid November 3, 2026 6 min read

How to keep the screen awake in your Expo app, in short

Install expo-keep-awake, import useKeepAwake, and call it at the top of the screen component that should stay lit. That is the entire feature for most apps. While that screen is on screen, the phone ignores its auto-lock timer. When the user navigates away and the component unmounts, the lock is released and normal sleep comes back on its own.

This matters more than it sounds. A user following a recipe with flour on their hands, holding a plank during a workout timer, or showing a ticket at a gate will not tap the screen to keep it awake. If your app goes dark at the exact moment they need it, that is the moment they decide your app is annoying.

expo-keep-awake at a glance

QuestionAnswer
Installnpx expo install expo-keep-awake
Works in Expo Go?Yes
PlatformsAndroid, iOS, tvOS, web (limited)
Simplest APIuseKeepAwake() inside a screen component
On and off controlactivateKeepAwakeAsync(tag) and deactivateKeepAwake(tag)
Needed for video playback?Usually no, expo-video keeps the screen on while playing by default

Step 1: Install expo-keep-awake

Run npx expo install expo-keep-awake. Using expo install picks the version that matches your SDK, which on SDK 58 is the 58.0.x line. The module ships in Expo Go, so you can test it on a real phone straight away without making a new [development build](/blog/expo-go-vs-development-build).

There is no permission prompt to design and nothing to configure in app.json. That makes it one of the cheapest quality wins in the whole SDK, closer to [haptic feedback](/blog/how-to-add-haptic-feedback-to-your-expo-app) than to anything that touches user data.

Step 2: Use the useKeepAwake hook on one screen

Inside the screen component, call useKeepAwake() before you return your JSX. In an Expo Router app that means the file for the route itself, for example app/recipe/[id]/cook.tsx, not the root _layout.tsx. The hook keeps the screen awake for as long as the component that calls it is mounted.

  • Put it on the focused, hands-busy screen: cook mode, the active workout, a reading view, a scanner, a boarding pass or ticket, a presentation or teleprompter.
  • Keep it off browse screens. A feed or a settings page does not need to stay lit, and the user expects the phone to lock there.
  • If the same screen has a paused state, like a timer that has finished, move the hook into a child component that only renders while the timer runs. Unmounting that child releases the lock.

Step 3: Turn it on and off with tags

When the lock should follow app state instead of a mounted screen, use the functions. Call activateKeepAwakeAsync(tag) when a timer starts and deactivateKeepAwake(tag) when it stops. If you leave out the tag, both use the same default tag, so they still pair up correctly.

Tags are where AI-written code usually gets this wrong. Each tag is its own lock, and the screen will only sleep again once every tag that was activated has been deactivated. If your workout feature activates 'workout' and your timer activates 'timer', stopping the workout does not release the timer's lock. Pick one tag per feature, store it in a constant, and use that constant on both calls.

Which API to use

SituationUseWhy
A whole screen should stay lituseKeepAwake()Releases automatically on unmount
Only while a timer or session runsactivateKeepAwakeAsync / deactivateKeepAwakeYou control the exact start and stop
Old code calling activateKeepAwake()Switch to activateKeepAwakeAsyncactivateKeepAwake is deprecated
Video playback with expo-videoNothing extrakeepScreenOnWhilePlaying is true by default

Our take: reach for the hook first. A forgotten deactivate call is a silent bug that only shows up as bad battery reviews, and the hook makes it impossible to forget.

Step 4: Handle the Android warning and the web

On Android, deactivating can throw an unhandled promise rejection when the original Activity is already gone, for example when the app is being torn down. The hook accepts an options object with suppressDeactivateWarnings: true to stop that exception. If you see a red box about keep awake while closing the app in development, that is the setting you want.

On the web, support is limited. isAvailableAsync() returns true on every platform except unsupported web browsers, so if your Expo app also ships to the web, check it before you show any Keep Screen On toggle. The addListener function and the listener option only do anything on the web, where the lock can be released when the user switches tabs. On native they are a no-op, so do not build logic on them for iOS or Android.

Step 5: Do not double up with video and audio

If the screen is a [video player](/blog/how-to-add-video-to-your-expo-app) built on expo-video, you likely do not need this module at all. The player's keepScreenOnWhilePlaying property defaults to true, so the screen stays on during playback and sleeps after it. On Android that only applies while a VideoView is visible, so use expo-keep-awake if you need the screen on with no video view showing.

For [audio](/blog/how-to-add-audio-to-your-expo-app), keeping the screen awake is usually the wrong goal. People listening to a lesson or a sleep sound want to lock the phone and keep listening. That is background audio, a different setting, and keeping the screen lit for it only burns battery.

A related touch for ticket and QR screens: users also expect the screen to be bright. That is a separate module, [expo-brightness](/blog/how-to-control-screen-brightness-in-your-expo-app), and the two pair well on a boarding pass screen.

Have Claude Code build it for you

Open your project in the Claude Code desktop app and name the exact screen. Left alone, AI-written code tends to put the hook in the root layout, use the deprecated activateKeepAwake, or mix tags so the lock never releases. A prompt that avoids all three:

Then add a line to your [CLAUDE.md](/blog/claude-md-for-expo-apps) such as "Keep awake: useKeepAwake only on focused screens (cook mode, active workout, tickets), never in a layout" so a later session does not undo it.

The short version

To keep the screen awake in your Expo app: install expo-keep-awake, call useKeepAwake() in the one screen that needs it, and let unmounting release it. Use activateKeepAwakeAsync and deactivateKeepAwake with one tag per feature when the lock should follow a timer, suppress the Android deactivate warning, check isAvailableAsync on the web, and leave video playback to expo-video.

If you are building your first iOS app with Claude Code and Expo and want feedback on it before App Review, bring it to App Store Launch Club. Members share their builds and help each other get unstuck, and the [curriculum](/curriculum) covers the full path from first build to first users. If you are adding more native polish, our guides to [locking screen orientation](/blog/how-to-lock-screen-orientation-in-your-expo-app) and [haptic feedback](/blog/how-to-add-haptic-feedback-to-your-expo-app) follow the same pattern. Join at applaunchclub.co for $9 a month.

Free app-building tips, straight to your inbox

Short, practical drops on app ideas, validating fast, store listings, and passing app review. No spam, unsubscribe anytime.

Frequently asked questions

How do I stop the screen from sleeping in an Expo app?

Install expo-keep-awake with npx expo install expo-keep-awake and call useKeepAwake() at the top of the screen component that should stay on. The screen will not sleep while that component is mounted, and normal sleep returns when it unmounts.

Does expo-keep-awake work in Expo Go?

Yes. expo-keep-awake is included in Expo Go and needs no permission or app.json config, so you can test it on a real phone right away.

What is the difference between useKeepAwake and activateKeepAwakeAsync?

useKeepAwake keeps the screen awake for as long as the component that calls it is mounted and releases automatically. activateKeepAwakeAsync turns the lock on until you call deactivateKeepAwake with the same tag, which suits timers and sessions that start and stop on one screen.

Why is my screen still not sleeping after I called deactivateKeepAwake?

Each tag is a separate lock. The screen only sleeps again after every activated tag has been deactivated, so a call with a different tag, or a mounted component still using useKeepAwake, will keep it on. Use one tag constant per feature for both calls.

Do I need expo-keep-awake for video playback?

Usually not. expo-video's keepScreenOnWhilePlaying defaults to true, so the screen stays on while a video plays. On Android that only applies while a VideoView is visible, so use expo-keep-awake if you need the screen on without one.

Is activateKeepAwake deprecated?

Yes. Use activateKeepAwakeAsync instead, paired with deactivateKeepAwake, or use the useKeepAwake hook, which handles both for you.

Last reviewed by David on November 3, 2026

David

Written by

David

Founder and app builder

Keep reading

ExpoClaude Code

How to Add Notification Actions to Your Expo App

To add notification actions to an Expo app, register a category with Notifications.setNotificationCategoryAsync, give it action buttons (and optionally a text reply), set categoryIdentifier on the notification, then read response.actionIdentifier in a response listener. Here is every action option, how to handle taps when the app was closed, the Android and iOS differences, and a Claude Code prompt that wires it all up.

David 8 min
Read article
ExpoClaude Code

How to Schedule Local Notifications in Your Expo App

To schedule local notifications in an Expo app, install expo-notifications, set a notification handler, ask for permission, create an Android channel, then call scheduleNotificationAsync with your content and a trigger like DAILY, WEEKLY or DATE. Here is every trigger type, how to cancel and list what is scheduled, why Android reminders arrive late, and a Claude Code prompt that builds the whole reminder flow.

David 8 min
Read article

Ready to build it yourself?

Join App Store Launch Club, the #1 community for building and launching apps, for $9/month.

← Back to the blog