diff --git a/README.md b/README.md index 8dd184b..b0b40b9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,16 @@ # 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 @@ -8,14 +18,6 @@ simple control capture event (like screenshot, screen record) in Android, iOS Na 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, @@ -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 diff --git a/android/build.gradle b/android/build.gradle index 30878fe..8bb8ea7 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -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' + } } } @@ -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') diff --git a/package.json b/package.json index 17a8170..4621f3c 100644 --- a/package.json +++ b/package.json @@ -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",