[BREAKGLASS] react-native-screen-capture allows you to protect screens in your app from being captured or recorded, as well as be notified if a screenshot is taken while your app is foregrounded.
Go to file
2023-01-02 00:53:29 +03:00
android Update ScreenCaptureModule.java 2023-01-01 23:58:37 +03:00
example Update app.js 2023-01-02 00:19:21 +03:00
ios Update ScreenCapture.m 2023-01-02 00:23:50 +03:00
.gitignore Update .gitignore 2022-12-30 01:01:28 +03:00
index.js Update index.js 2023-01-02 00:03:29 +03:00
LICENSE Initial commit 2022-12-28 13:24:14 +03:00
package.json Update package.json 2023-01-02 00:15:00 +03:00
preview.gif Update preview.gif 2023-01-02 00:53:29 +03:00
react-native-screen-capture.podspec Update react-native-screen-capture.podspec 2022-12-30 01:01:42 +03:00
README.md Update README.md 2023-01-02 00:48:02 +03:00
TODO New 0.0.5-rc.0 2023-01-01 23:56:23 +03:00

react-native-screen-capture

Screen Capture allows you to protect screens in your app from being captured or recorded, as well as be notified if a screenshot is taken while your app is foregrounded.

Keep Awake, keep the screen from going to sleep. iOS and Android

Installation

npm i react-native-screen-capture

Preview

Usage

import { disallowScreenshot, keepAwake, userDidTakeScreenshot, } from 'react-native-screen-capture';

// disable screenshots
disallowScreenshot(true);

// enable screenshots
disallowScreenshot(false);

// Keep awake true
keepAwake(true);

// Keep awake false
keepAwake(false);

// userDidTakeScreenshot
// function to execute when user did a screenshot (ios only)
const onScreenshot = () => {
   console.log("Hey, screenshot detected!");
};
// its important have an "unsubscribe" to remove listener from screen is dismounted
const eventListener = userDidTakeScreenshot(onScreenshot);
eventListener.remove();

Roadmap

Status Platform Goal
Android Screenshot disable
iOS Screenshot disable
Android Keep awake on or off
iOS Keep awake on or off
🚧 Android Record capture disable
🚧 iOS Record capture disable
🚧 Android Screenshot callback
iOS Screenshot callback
🚧 Android Record capture callback
🚧 iOS Record capture callback

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT