Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@

# react-native-screenshot-detector

Note: this project is designed to work with the newer version of React Native library imports, i.e. React Native >= 0.40.0
Note: this project is designed to work with the newer version of React Native library imports, i.e. React Native >= 0.40.0, and will only work on iOS as Android does not provide the underlying functionality needed to track screenshots.

## Getting started

`$ npm install react-native-screenshot-detector --save`
React Native < 0.60.0

`$ npm install react-native-screenshot-detector`

`$ react-native link react-native-screenshot-detector`

React Native >= 0.60.0

`$ npm install react-native-screenshot-detector`

## Usage

Update the AppDelegate.m file to include the following:

# iOS
```objectivec
#import <RNScreenshotDetector/RNScreenshotDetector.h>

.........

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// ... setup code
Expand Down
19 changes: 19 additions & 0 deletions RNScreenshotDetector.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
require 'json'

package = JSON.parse(File.read(File.join(__dir__, 'package.json')))

Pod::Spec.new do |s|
s.name = 'RNScreenshotDetector'
s.version = package['version']
s.summary = package['description']
s.license = package['license']

s.authors = package['author']
s.homepage = package['homepage']
s.platform = :ios, "9.0"

s.source = { :git => "https://github.com/blend/react-native-screenshot-detector.git", :tag => "v#{s.version}" }
s.source_files = "ios/**/*.{h,m}"

s.dependency 'React'
end
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@

{
"name": "react-native-screenshot-detector",
"version": "1.0.0",
"description": "",
"version": "1.0.1",
"homepage": "https://github.com/blend/react-native-screenshot-detector",
"description": "A tool for detecting ios screenshots on iOS",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Expand All @@ -13,7 +14,7 @@
"author": "gcarling",
"repository": {
"type": "git",
"url": "https://github.com/blendlabs/react-native-screenshot-detector"
"url": "https://github.com/blend/react-native-screenshot-detector"
},
"license": "MIT"
}