Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-screenshotcatch-dsg

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-screenshotcatch-dsg

A ReactNative Tool for catch Screen Shot Event

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

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
  1. 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')
    
  2. 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

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()

Keywords

FAQs

Package last updated on 19 Nov 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc