{"id":13471976,"url":"https://github.com/Shashank2406/react-native-screen-record-prevent","last_synced_at":"2025-03-26T15:31:00.065Z","repository":{"id":41080475,"uuid":"440839713","full_name":"Shashank2406/react-native-screen-record-prevent","owner":"Shashank2406","description":null,"archived":false,"fork":false,"pushed_at":"2023-05-29T11:52:39.000Z","size":25,"stargazers_count":12,"open_issues_count":4,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-01T10:48:47.204Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Shashank2406.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-12-22T11:46:15.000Z","updated_at":"2024-09-21T12:39:13.000Z","dependencies_parsed_at":"2022-09-10T19:51:04.879Z","dependency_job_id":null,"html_url":"https://github.com/Shashank2406/react-native-screen-record-prevent","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shashank2406%2Freact-native-screen-record-prevent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shashank2406%2Freact-native-screen-record-prevent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shashank2406%2Freact-native-screen-record-prevent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shashank2406%2Freact-native-screen-record-prevent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Shashank2406","download_url":"https://codeload.github.com/Shashank2406/react-native-screen-record-prevent/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222151628,"owners_count":16939423,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T16:00:50.835Z","updated_at":"2024-10-30T02:31:09.680Z","avatar_url":"https://github.com/Shashank2406.png","language":"Java","funding_links":[],"categories":["Java"],"sub_categories":[],"readme":"\n# react-native-screen-record-prevent\n\n## Getting started\n\n`$ npm install react-native-screen-record-prevent --save`\n\n\n### Mostly automatic installation\n\n`$ react-native link react-native-screen-record-prevent`\n\n### Manual installation\n\n\n#### iOS\n\n1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]`\n2. Go to `node_modules` ➜ `react-native-screen-record-prevent` and add `RNScreenRecordPrevent.xcodeproj`\n3. In XCode, in the project navigator, select your project. Add `libRNScreenRecordPrevent.a` to your project's `Build Phases` ➜ `Link Binary With Libraries`\n4. Run your project (`Cmd+R`)\u003c\n\n#### Android\n\n1. Open up `android/app/src/main/java/[...]/MainActivity.java`\n  - Add `import com.videoready.screenrecordprev;` to the imports at the top of the file\n  - Add `new RNPreventRecordPackage()` to the list returned by the `getPackages()` method\n2. Append the following lines to `android/settings.gradle`:\n    ```\n    include ':react-native-screen-record-prevent'\n    project(':react-native-screen-record-prevent').projectDir = new File(rootProject.projectDir,  '../node_modules/react-native-screen-record-prevent/android')\n    ```\n3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:\n    ```\n      compile project(':react-native-screen-record-prevent')\n    ```\n\n\n\n## Usage\n#### For Android - Just enable the RNScreenRecordPrevent.\n```javascript\nimport RNScreenRecordPrevent from 'react-native-screen-record-prevent';\n\nRNScreenRecordPrevent.enabled(true/false);\n```\n#### For iOS - You can get a screen recording event from here and then make your own view controller.\n```javascript\n  const iosNativeEvent = new NativeEventEmitter(RNScreenRecordPrevent);\n  iosNativeEvent.addListener('ScreenRecordingEvent', data =\u003e console.log(data));\n```\n\n#### For iOS - You can get a check screen recording is active or not\n```javascript\n  RNScreenRecordPrevent.checkRecordingStatus().then(value =\u003e {\n    console.log(value);\n  });\n```\n\n\u003eNote - On iOS, we can't stop screen recording as we can on Android. For this, you'll need to add your own view controller. You can prevent screen recording by adding a view with a black backdrop over your video player when 'ScreenRecodingEvent' returns true.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FShashank2406%2Freact-native-screen-record-prevent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FShashank2406%2Freact-native-screen-record-prevent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FShashank2406%2Freact-native-screen-record-prevent/lists"}