{"id":18819434,"url":"https://github.com/a7medev/react-native-prevent-screenshots","last_synced_at":"2025-07-31T17:42:19.595Z","repository":{"id":49374350,"uuid":"420389798","full_name":"a7medev/react-native-prevent-screenshots","owner":"a7medev","description":"Prevent Screenshots in your React Native app when needed. 🦄","archived":false,"fork":false,"pushed_at":"2022-07-26T05:38:23.000Z","size":679,"stargazers_count":74,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-23T14:18:53.343Z","etag":null,"topics":["react-native"],"latest_commit_sha":null,"homepage":"","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/a7medev.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-10-23T11:10:11.000Z","updated_at":"2024-10-19T17:03:49.000Z","dependencies_parsed_at":"2022-09-16T07:21:08.832Z","dependency_job_id":null,"html_url":"https://github.com/a7medev/react-native-prevent-screenshots","commit_stats":null,"previous_names":["a7med-mahmoud/react-native-prevent-screenshots"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a7medev%2Freact-native-prevent-screenshots","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a7medev%2Freact-native-prevent-screenshots/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a7medev%2Freact-native-prevent-screenshots/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a7medev%2Freact-native-prevent-screenshots/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/a7medev","download_url":"https://codeload.github.com/a7medev/react-native-prevent-screenshots/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248797160,"owners_count":21163092,"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":["react-native"],"created_at":"2024-11-08T00:23:04.115Z","updated_at":"2025-04-13T23:33:12.609Z","avatar_url":"https://github.com/a7medev.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Native Prevent Screenshots\n\nPrevent Screenshots in your React Native app when needed. 🦄\n\n## Installation\n\nFirst, you need to install the package using the command above:\n\n```sh\nnpm install react-native-prevent-screenshots --save\n```\n\nOr if you're using Yarn:\n\n```sh\nyarn add react-native-prevent-screenshots\n```\n\n### React Native \u003c= 0.59\n\nFor React Native \u003c= 0.59, there's no autolinking so you have to link the package using the command below:\n\n```sh\nreact-native link react-native-prevent-screenshots\n```\n\n### Expo Managed Workflow Support\n\nIn order to use `react-native-prevent-screenshots` with Expo you have to have native `android` folder in your app, fortunately you can do that easily without ejecting just by using this command:\n\n```sh\nexpo run:android\n```\n\nwhich will generate the `android` folder for you and allow you to use custom native code for android while still using Expo managed workflow.\n\n\u003e NOTE: you don't have to do the same for iOS because we use the React Native `AppState` JavaScript API on iOS.\n\n## Usage\n\nFor iOS support you have to wrap the App component with the `withPreventScreenshots` call like this:\n\n```js\nimport { withPreventScreenshots } from 'react-native-prevent-screenshots';\n\nfunction App() {\n  // ...\n}\n\nexport default withPreventScreenshots(App);\n```\n\nNow, you can now call `PreventScreenshots.start()` and `PreventScreenshots.stop()` functions anywhere in your app to start/stop preventing screenshots.\n\n```js\nimport { PreventScreenshots } from 'react-native-prevent-screenshots';\n\n// Prevent Screenshots (returns `Promise\u003cboolean\u003e` of the prevention state)\nPreventScreenshots.start();\n\n// Allow Screenshots (returns `Promise\u003cboolean\u003e` of the prevention state)\nPreventScreenshots.stop();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa7medev%2Freact-native-prevent-screenshots","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fa7medev%2Freact-native-prevent-screenshots","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa7medev%2Freact-native-prevent-screenshots/lists"}