Get started
A native React Native library for preventing your app from screenshots and screen recordings, with powerful event detection capabilities.
✨ Key Features
🛡️ Screenshot and Screen Recording prevention
Prevent your app's sensitive content from being captured or recorded, with 3 separated overlay types:
- Solid color overlay — Display a solid color (e.g., black, white, or your custom hex color).
- Blur effect — Apply a blur overlay that obscures the content.
- Custom image — Show your own image, logo, or watermark during capture.
📸 Screenshot Detection
Real-time detection of screenshot events, triggered immediately when a screenshot is captured
- React instantly — Execute custom logic when a screenshot is taken.
- Access screenshot metadata — Retrieve the file path of the captured screenshot on the device for your own purposes.
- Control event screenshot — Limit the number of screenshot events.
- Track status — check ScreenGuard is currently active when the screenshot event occurs.
🎥 Screen Recording Detection
Monitor screen recording activity in real-time.
- Detect recording state — Know when screen recording begins and ends on the device.
- Respond to recording attempts — Execute custom actions when recording is detected.
- Cross-platform support — Works on iOS 13+ and Android 15+ (API 35+).
📝 Activity Logging
Comprehensive logging for editing or debugging purposes.
How It Works
React Native ScreenGuard bridges native code (iOS Objective-C, Android Java) and JavaScript, using FLAG_SECURE on Android and UITextField with customizable on iOS.
- Install the library
- Initialize settings with
initSettings() - Activate ScreenGuard with
register(),registerWithBlurView(), orregisterWithImage() - (Optional) Listen to events with
useSGScreenShotoruseSGScreenRecordhooks
Pre-requisites
If you're already familiar with JavaScript, React and React Native, then you'll be able to get moving with React Native Screenguard quickly! If not, we highly recommend you to gain some basic knowledge first, then come back here when you're done.
Here are some resources to help you out:
Minimum requirements
- Node.js version 15.0 or above:
- When installing Node.js, you are recommended to check all checkboxes related to dependencies.
react-native>= 0.68Android SDK>= 29Cocoapods>= 1.1.4iOS minimum deployment target>= 13typescript>= 4.0.0