A react native android module for obscuring applications when switching applications and preventing taking screenshots of the application.
npm install react-native-obscureA react native android module for obscuring applications when switching applications and preventing taking screenshots of the application.
#### NPM
```
$ npm install react-native-obscure --save
#### Yarn
``
$ yarn add react-native-obscure
``
$ react-native link react-native-obscure
#### Android
1. Open up android/app/src/main/java/[...]/MainActivity.javaimport diegofhg.ObscurePackage;
- Add to the imports at the top of the filenew ObscurePackage()
- Add to the list returned by the getPackages() methodandroid/settings.gradle
2. Append the following lines to :`
`
include ':react-native-obscure'
project(':react-native-obscure').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-obscure/android')
android/app/build.gradle
3. Insert the following lines inside the dependencies block in :`
`
compile project(':react-native-obscure')
You can use it programmatically for activating/deactivating the obscuring at any time, use it app-wide or per component.
activateObscure: Activates the obscuring.
deactivateObscure: Deactivate the obscuring.
`jsx
import React, { Component } from 'react';
import { View, Text } from 'react-native';
import Obscure from 'react-native-obscure';
export default class App extends Component {
componentWillMount() {
Obscure.activateObscure();
}
componentWillUnmount() {
Obscure.deactivateObscure();
}
render() {
return(
);
}
}
``
- Add iOS support.