# react-native-screenshotcatch-dsg

> A ReactNative Tool for catch Screen Shot Event

Latest version **1.0.0** (published 2020-11-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-screenshotcatch-dsg
pnpm add react-native-screenshotcatch-dsg
yarn add react-native-screenshotcatch-dsg
bun add react-native-screenshotcatch-dsg
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2020-11-19 |
| First published | 2020-11-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 29.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | callcter |
| Maintainers | ql488577 |
| Keywords | react-native, screen-shot, screen-capture, ios, android |

## Links

- npm: https://www.npmjs.com/package/react-native-screenshotcatch-dsg
- Repository: https://github.com/callcter/react-native-screenshotcatch
- Issues: https://github.com/callcter/react-native-screenshotcatch/issues
- npm.io page: https://npm.io/package/react-native-screenshotcatch-dsg

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2020-11-19

## README

# react-native-screenshotcatch

## Getting started

`$ npm install react-native-screenshotcatch --save`

### Installation

#### iOS

RN version >= 0.60

autolink

RN Version < 0.60
```
pod 'RNScreenshotcatch', :path => '../node_modules/react-native-screenshotcatch'
```

#### Android

1. Open up `android/app/src/main/java/[...]/MainActivity.java`
  - Add `import com.dreamser.screenshotcatch.RNScreenshotcatchPackage;` to the imports at the top of the file
  - Add `new RNScreenshotcatchPackage()` to the list returned by the `getPackages()` method
2. Append the following lines to `android/settings.gradle`:
  	```
  	include ':react-native-screenshotcatch'
  	project(':react-native-screenshotcatch').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-screenshotcatch/android')
  	```
3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:
  	```
      compile project(':react-native-screenshotcatch')
  	```

## Config

#### Android

```
// MainActivity.java
import com.dreamser.screenshotcatch.RNScreenshotcatchModule;
public class MainActivity extends ReactActivity {
   @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ScreenShotShareModule.initScreenShotShareSDK(this);  // here
    }
    // ...other code
}
```

add

## Usage
```javascript
import RNScreenshotcatchUtil from 'react-native-screenshotcatch';

export default class Root extends React.Component{
	componentWillMount(){
		ScreenShotShareUtil.startListener(res => {
      if(res && res.code === 200){
        // success
      }else{
				// fail
      }
    })
	}
	componentWillUnmount(){
    ScreenShotShareUtil.stopListener()
  }
}

```

## Other API

Judge Android phone has NavigationBar
```
const hasBar = await ScreenShotShareUtil.hasNavigationBar()
```

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