New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

react-native-screen-blocker

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-screen-blocker

React Native module to block screenshots and screen recording on Android and iOS

latest
npmnpm
Version
1.0.8
Version published
Weekly downloads
10
900%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-screen-blocker

React Native module to block screenshots and screen recordings on Android and iOS devices by leveraging native platform capabilities.

Table of Contents

  • Features
  • Supported Platforms
  • Installation
  • Usage
  • API
  • Example
  • Contact

Features

  • Prevent screenshots and screen recordings at the OS level.
  • Simple API to enable and disable protection dynamically.
  • Supports React Native 0.60+ with automatic linking.
  • Uses FLAG_SECURE on Android.
  • Uses iOS 13+ setSecure: API with fallback options.

Supported Platforms

PlatformMinimum VersionNotes
AndroidAPI 16+Uses WindowManager.LayoutParams.FLAG_SECURE
iOS11.0+iOS 13+ uses setSecure:; earlier iOS uses overlays and observers

Installation

  • Install via npm or yarn:
npm install react-native-screen-blocker
# or
yarn add react-native-screen-blocker
  • For iOS, install CocoaPods dependencies:
cd ios && pod install && cd ..
  • For React Native < 0.60, link manually:
react-native link react-native-screen-blocker

Usage

Import the module

import { enableScreenBlock, disableScreenBlock } from 'react-native-screen-blocker';

Enable Screen Block

Call early in the app lifecycle.

enableScreenBlock();

Disable Screen Block

disableScreenBlock();

API

MethodDescriptionReturns
enableScreenBlock()Enables screenshot and screen recording protectionPromise<void>
disableScreenBlock()Disables protection and allows screenshots/recordingsPromise<void>

Example

import React, { useEffect } from 'react';
import { enableScreenBlock, disableScreenBlock } from 'react-native-screen-blocker';

export default function App() {
  useEffect(() => {
    enableScreenBlock();
  }, []);

  return (
    // App JSX
  );
}

Contact

For questions or support, reach me at: anweshan.mukherjee@pwc.com

Keywords

react-native

FAQs

Package last updated on 11 Feb 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts