1.2.1 • Published 2 years ago

react-native-screenshield v1.2.1

Weekly downloads
2
License
MIT
Repository
github
Last release
2 years ago

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:

namerequireddesc
sourceyescheck RN Image prop
styleyescheck RN Image prop

It also accepts all RN Image props.

Methods:

namedesc
init(key?: string): voidiOS - key is required - ScreenShieldKit License, Android - not required, not used
isInitialized(): booleanReturn if module was initialized
onSettingFlagFailed?: (error: Error) => voidmethod 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