# react-native-flag-secure-android

> A simple module used to add FLAG_SECURE to the main activity. FLAG_SECURE prevents the users and the app to take screenshots of the app content.

Latest version **1.0.3** (published 2022-03-10) · ISC license · 0 weekly downloads

## Install

```sh
npm install react-native-flag-secure-android
pnpm add react-native-flag-secure-android
yarn add react-native-flag-secure-android
bun add react-native-flag-secure-android
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2022-03-10 |
| First published | 2019-09-27 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 15 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Maintainers | staltz |

## Links

- npm: https://www.npmjs.com/package/react-native-flag-secure-android
- Repository: https://github.com/staltz/react-native-flag-secure-android
- Homepage: https://github.com/staltz/react-native-flag-secure-android#readme
- Issues: https://github.com/staltz/react-native-flag-secure-android/issues
- npm.io page: https://npm.io/package/react-native-flag-secure-android

## Recent versions

- 1.0.3 (latest) — 2022-03-10
- 1.0.2 — 2019-09-27
- 1.0.1 — 2019-09-27
- 1.0.0 — 2019-09-27

## README

# react-native-flag-secure-android

A simple module used to add `FLAG_SECURE` to the main activity. `FLAG_SECURE` prevents the users and the app to take screenshots of the app content. 

### Manual Install

1. Open up `android/app/src/main/java/[...]/MainApplication.java (React Native 0.29+)
  - Add `import com.staltz.flagsecure.FlagSecurePackage;` to the imports at the top of the file
  - Add `new FlagSecurePackage()` to the list returned by the `getPackages()` method

3. Append the following lines to `android/settings.gradle`:

	```groovy
	include ':react-native-flag-secure-android'
	project(':react-native-flag-secure-android').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-flag-secure-android/android')
	```

4. Insert the following lines inside the dependencies block in `android/app/build.gradle`:

	```groovy
  	compile project(':react-native-flag-secure-android')
  	```

## Usage

```jsx

import FlagSecure from 'react-native-flag-secure-android';

function flagSecure(enable) {
  if (enable) {
    FlagSecure.activate();
  } else {
    FlagSecure.deactivate();
  }
}

```

## Notes
Please note that this module is an adpation of the [react-native-keep-awake](https://github.com/corbt/react-native-keep-awake) module.

---
_Source: https://npm.io/package/react-native-flag-secure-android · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
