Skip to content

Commit

Permalink
release: v1.8.0 (#20)
Browse files Browse the repository at this point in the history
## Update
- supoort RN 0.73 and higher
  • Loading branch information
wn-na authored Aug 13, 2023
2 parents 8a11105 + 554dc4b commit 3d24e8d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 16 deletions.
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
# react-native-capture-protection

simple control capture event (like screenshot, screen record) in Android, iOS Native
> 🚀 Simple control capture event (like screenshot, screen record) in Android, iOS + React Native
![Simulator Screen Recording](https://user-images.githubusercontent.com/37437842/206644553-e4c3f2bc-b624-47ac-a005-132199e049b2.gif)

## Features

- iOS Capture Event via screen recording, capture capture with Listener
- allow, prevent Android, iOS Capture Event
- allow, prevent iOS Record Screen
- Provider, Hooks
- RN 0.73 and higher

## Installation

```sh
npm install react-native-capture-protection
```

## Preview

### prevent, allow screenshot in iOS

![Simulator Screen Recording - iPhone 14 - 2022-12-09 at 16 02 15](https://user-images.githubusercontent.com/37437842/206644553-e4c3f2bc-b624-47ac-a005-132199e049b2.gif)

## Usage

```js
import {
CaptureProtection,
Expand Down Expand Up @@ -45,11 +47,10 @@ const Component = (props) => {
};
```

More Infomation, please read this
## Docs

- [method](https://github.com/0xlethe/react-native-capture-protection/wiki/method)
- [type](https://github.com/0xlethe/react-native-capture-protection/wiki/type)
- [migration to v1](https://github.com/0xlethe/react-native-capture-protection/wiki/how-to-migration-v0-to-v1)

## Contributing

Expand Down
20 changes: 16 additions & 4 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
buildscript {
repositories {
// The Android Gradle plugin is only required when opening the Android folder stand-alone.
// This avoids unnecessary downloads and potential conflicts when the library is included as a
// module dependency in an application project.
if (project == rootProject) {
repositories {
google()
mavenCentral()
}
}

dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
}
}
}

Expand All @@ -30,6 +35,13 @@ def getExtOrIntegerDefault(name) {
android {
compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')

//Get Android Gradle Plugin version
def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
//Apply namespace only if Android Gradle Plugin version equal or greater than 7
if (agpVersion.tokenize('.')[0].toInteger() >= 7) {
namespace "com.captureprotection"
}

defaultConfig {
minSdkVersion getExtOrIntegerDefault('minSdkVersion')
targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-capture-protection",
"version": "1.7.0",
"version": "1.8.0",
"description": "It’s a library for React Native to control simple capture events(i.e. Screenshot or Screen record)",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down

0 comments on commit 3d24e8d

Please sign in to comment.