How to Prevent Screenshots in Your Expo App

DavidDavid November 14, 2026 7 min read
A smartphone lying face up on a dark slate desk with a dimmed screen, a brass padlock and a leather notebook beside it in cool blue evening light
Original image, App Store Launch Club

How to prevent screenshots in your Expo app, in short

Install expo-screen-capture. In the screen you want to protect, import { usePreventScreenCapture } from 'expo-screen-capture' and call usePreventScreenCapture() at the top of the component. While that component is mounted, the user cannot take a screenshot or record the screen. When they navigate away and the component unmounts, capture is allowed again on its own.

If you need manual control, for example blocking capture only while a card number is revealed, call await ScreenCapture.preventScreenCaptureAsync() to turn protection on and await ScreenCapture.allowScreenCaptureAsync() to turn it off. Without that second call, protection stays on until the app restarts.

expo-screen-capture at a glance (SDK 58)

QuestionAnswer
Installnpx expo install expo-screen-capture
PlatformsAndroid and iOS
Works in Expo Go?Yes
Block while a screen is openusePreventScreenCapture()
Block and unblock by handpreventScreenCaptureAsync() and allowScreenCaptureAsync()
Blur the app switcher previewenableAppSwitcherProtectionAsync() (iOS only)
Detect a screenshotuseScreenshotListener() or addScreenshotListener()
Check supportisAvailableAsync()

Which screens should block screenshots (and which should not)

Blocking capture is a tool for specific screens, not a setting for the whole app. There are two good reasons to use it: the screen shows something sensitive, like a password, a recovery code or card details, or it shows paid content you do not want recorded and passed around.

Where blocking helps and where it hurts

ScreenBlock capture?Why
Recovery codes, passwords, card detailsYesA screenshot ends up in the photo library and often in a cloud backup
Paid lessons, premium video, paywalled contentYesStops the easy copy, though not a second phone pointed at the screen
Private messages or health dataOftenWorth it if a leak would hurt the user, not just you
Results, scores, finished designs, statsNoThese are what people screenshot to show friends
Onboarding, settings, normal feedsNoIt only frustrates people and gains you nothing

Be honest with yourself about what this stops. It stops the built-in screenshot and screen recording on the device. It does not stop someone holding up a second phone. Treat it as a speed bump for casual copying and a guard against sensitive data landing in photo backups, not as copy protection.

Step 1: Install expo-screen-capture

Run npx expo install expo-screen-capture. On SDK 58 that installs the 58.0.x line. It is included in Expo Go, so you can try blocking on your own phone right away without a new build.

Blocking capture needs no permissions on either platform. The only time permissions come into it is detecting screenshots on older Android versions, which Step 5 covers. If you are not sure whether a module needs a development build, our [Expo Go vs development build](/blog/expo-go-vs-development-build) guide explains the difference.

Step 2: Block capture on one screen with the hook

For most apps the hook is all you need. Put usePreventScreenCapture() as the first line inside the component for the protected screen, for example your RecoveryCodesScreen or PremiumLessonScreen. Protection switches on when the screen mounts and off when it unmounts, so you never have to remember to clean up.

  • Call it in the screen component itself, not in your root layout. In the root layout it would protect every screen in the app.
  • With Expo Router, keep in mind that a screen further back in a stack can stay mounted while a new screen is pushed on top. If a protected screen is still in the stack, protection is still on. Test the exact navigation path users take.
  • If two mounted components each use the hook, give them different keys, for example usePreventScreenCapture('recovery') and usePreventScreenCapture('video'). Keys stop one component from switching protection off while the other still needs it.

Navigation details for stacks and tabs are in our [Expo Router guide](/blog/how-to-use-expo-router-for-app-navigation).

Step 3: Turn protection on and off yourself

Use the imperative calls when protection depends on state rather than on which screen is open. A common case: a card or code is hidden behind a Reveal button. Call await ScreenCapture.preventScreenCaptureAsync('reveal') when the user taps Reveal, and await ScreenCapture.allowScreenCaptureAsync('reveal') when they hide it again or leave the screen.

  • The key you pass to allowScreenCaptureAsync must match the key you passed to preventScreenCaptureAsync. If you leave both out, they share the key 'default'.
  • If you used several keys, every one of them has to be allowed again before capture is re-enabled. That is by design, so one part of the app cannot silently undo another.
  • Calling preventScreenCaptureAsync again with a key that is already active does nothing, and calling allowScreenCaptureAsync before any prevent call does nothing either.
  • Always pair a prevent with an allow in a cleanup path, such as the return function of a useEffect. Otherwise protection quietly sticks around until the app restarts.

Step 4: Hide the app switcher preview

Blocking screenshots leaves one gap people forget: the preview the system shows when the user opens the app switcher. Whatever was on screen when they swiped away is visible there, to anyone looking over their shoulder.

How each platform handles the app switcher

PlatformWhat you doWhat the user sees
AndroidNothing extra. preventScreenCaptureAsync and the hook already cover itA blank preview in the recent apps screen
iOSCall ScreenCapture.enableAppSwitcherProtectionAsync(blurIntensity)A blurred preview in the app switcher, in the background and during interruptions like calls or Control Center

On iOS, blurIntensity runs from 0.0 (no blur) to 1.0 (maximum blur) and defaults to 0.5. The blur is removed automatically when the app becomes active again. Call ScreenCapture.disableAppSwitcherProtectionAsync() to turn it off. For a banking-style app, enabling it once at startup is reasonable. For most apps, enable it only while a sensitive screen is open. If you want a visible blur inside your own UI as well, see [how to add a blur effect](/blog/how-to-add-a-blur-effect-to-your-expo-app).

Step 5: Detect screenshots instead of blocking them

Sometimes the right move is to allow the screenshot and react to it. A messaging app might tell the other person, a quiz app might note it, or you might show a gentle "share this instead" button that sends a proper link. The listener fires after a screenshot is taken while your app is in the foreground. It cannot stop the screenshot.

  • In a component, call useScreenshotListener(() => { ... }). It starts listening when the component mounts and stops when it unmounts.
  • Outside a hook, const subscription = ScreenCapture.addScreenshotListener(() => { ... }) and call subscription.remove() when you are done. removeScreenshotListener still exists but is deprecated.
  • On iOS, no permission is needed. getPermissionsAsync and requestPermissionsAsync always resolve to granted.
  • On Android 14 and later, no permission is needed either. Android 13 needs READ_MEDIA_IMAGES, and versions before 13 need READ_EXTERNAL_STORAGE, added through the android.permissions key in app.json.

Step 6: Test it on a real device and the simulators

  • On a physical phone, open the protected screen and take a screenshot and a screen recording the normal way. Then navigate away and confirm screenshots work again.
  • In the iOS Simulator, use Device > Trigger Screenshot from the menu bar to fire a screenshot and check your listener.
  • In the Android Emulator, run adb shell input keyevent 120 in a separate terminal to trigger a screenshot.
  • Open the app switcher on both platforms while the protected screen is showing and check the preview is blank or blurred.
  • Walk the full navigation path, including going back, switching tabs and opening a modal, to make sure protection does not leak onto screens that should allow it.

If anything behaves differently on device than in Expo Go, our guide to [debugging an Expo app on a device](/blog/how-to-debug-expo-app-on-device) walks through getting logs off the phone.

Have Claude Code build it for you

Open your project in the Claude Code desktop app and describe the result. Left alone, AI-written code for this often protects the entire app from the root layout, forgets to call allowScreenCaptureAsync, uses the deprecated removeScreenshotListener, or adds a photo permission it does not need. A prompt that heads those off:

Then add a line to your [CLAUDE.md](/blog/claude-md-for-expo-apps) such as "Screen capture: block per screen with usePreventScreenCapture and a key, never app-wide, no photo permissions for detection" so later sessions follow the same rule. If the protected screen holds a token or recovery code, store it with [expo-secure-store](/blog/how-to-store-data-securely-in-your-expo-app) too, since blocking a screenshot does nothing for data sitting unencrypted on disk.

The short version

To prevent screenshots in your Expo app: install expo-screen-capture, call usePreventScreenCapture in each sensitive screen, use preventScreenCaptureAsync and allowScreenCaptureAsync with matching keys when protection depends on state, blur the iOS app switcher with enableAppSwitcherProtectionAsync, and use useScreenshotListener when you want to react rather than block. Protect the few screens that need it and leave the rest shareable.

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 your app has a sign-in screen worth protecting, our guide to [adding Face ID](/blog/how-to-add-face-id-to-your-expo-app) pairs well with this one. 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 prevent screenshots in an Expo app?

Install expo-screen-capture with npx expo install expo-screen-capture and call usePreventScreenCapture() inside the screen component you want to protect. Screenshots and screen recordings are blocked while that component is mounted.

Does expo-screen-capture work in Expo Go?

Yes. It is included in Expo Go on Android and iOS, so you can test blocking on your phone without making a development build.

Does preventing screen capture need a permission?

No. Blocking screenshots and recordings needs no permission on either platform. Only screenshot detection on Android 13 and earlier needs a photo permission, and on Android 14 and later and on iOS it needs none.

How do I hide my app in the iOS app switcher?

Call ScreenCapture.enableAppSwitcherProtectionAsync with a blur intensity from 0.0 to 1.0, which defaults to 0.5. It blurs the preview when the app is in the switcher or the background and removes the blur when the app is active again. On Android, preventing screen capture already shows a blank preview.

Can I detect when a user takes a screenshot?

Yes. Use the useScreenshotListener hook in a component, or ScreenCapture.addScreenshotListener and call remove() on the subscription when done. It fires after the screenshot is taken while your app is in the foreground, so it cannot stop it.

Why are screenshots still blocked after leaving the screen?

Either a protected screen is still mounted further back in your navigation stack, or you called preventScreenCaptureAsync without a matching allowScreenCaptureAsync. Every key you used must be allowed again, or protection lasts until the app restarts.

Last reviewed by David on November 14, 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