alimek / react-native-screenshield

Prevent doing screenshot of your APP programically.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-native-screenshield

Prevent Screenshot Image, block doing screenshot dynamically in your iOS/Android app.

For iOS - using ScreenShieldKit

For Android - using flag FLAG_SECURE

Installation

  • STEP 0 - IMPORTANT - only for want support iOS - put ScreenShieldKit.framework in ios project dir.
npm install react-native-screenshield

or

yarn add react-native-screenshield

Linking

ReactNative auto-linking will do the magic for you.

API

ProtectedView props:

name required desc
source yes check RN Image prop
style yes check RN Image prop

It also accepts all RN Image props.

Methods:

name desc
init(key?: string): void iOS - key is required - ScreenShieldKit License, Android - not required, not used
isInitialized(): boolean Return if module was initialized
onSettingFlagFailed?: (error: Error) => void method which is failed when settings flag on android failed

Usage

import ScreenShield, { ProtectedView } from "react-native-screenshield";

// ...
ScreenShield.init('abdc'); // config for iOS and Android
or
ScreenShield.init(); // it will just work for Android then, on iOS fallback `Image` component will be used for `ProtectedView`
// ...

<ProtectedView source={image} style={{ width: 100, height: 100 }} />

License

MIT

About

Prevent doing screenshot of your APP programically.

License:MIT License


Languages

Language:Objective-C 23.4%Language:TypeScript 20.9%Language:Ruby 19.6%Language:Java 16.7%Language:Kotlin 11.8%Language:JavaScript 6.7%Language:Shell 0.9%