Gathering detailed insights and metrics for @capacitor-community/privacy-screen
Gathering detailed insights and metrics for @capacitor-community/privacy-screen
Gathering detailed insights and metrics for @capacitor-community/privacy-screen
Gathering detailed insights and metrics for @capacitor-community/privacy-screen
⚡️ Capacitor plugin that protects your app from displaying a screenshot in Recents screen/App Switcher.
npm install @capacitor-community/privacy-screen
Typescript
Module System
Node Version
NPM Version
Swift (50.32%)
Java (21.2%)
TypeScript (17.3%)
Ruby (4.96%)
Objective-C (3.78%)
JavaScript (2.43%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
93 Stars
136 Commits
26 Forks
8 Watchers
2 Branches
28 Contributors
Updated on May 26, 2025
Latest Version
6.0.0
Package Id
@capacitor-community/privacy-screen@6.0.0
Unpacked Size
46.63 kB
Size
11.18 kB
File Count
32
NPM Version
10.8.2
Node Version
20.18.0
Published on
Jan 28, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
@capacitor-community/privacy-screen
Capacitor Privacy Screen Plugin
⚡️ Capacitor plugin that protects your app from displaying a screenshot in Recents screen/App Switcher.
On Android, this plugin sets the FLAG_SECURE flag to treat the content of the window as secure, preventing it from appearing in screenshots or from being viewed on non-secure displays.
On iOS, this plugin hides the webview window when the app is no longer active and loses focus (UIApplicationWillResignActiveNotification) so that a gray screen is shown instead. It also prevents screenshots (a black screen will be captured).
Disabling screenshots can interfere with plugins that hide the WebView like the Camera plugin. To avoid issues call disable
before using a plugin and then enable
after you are finished.
Maintainer | GitHub | Social |
---|---|---|
Robin Genz | robingenz | @robin_genz |
npm install @capacitor-community/privacy-screen
npx cap sync
These configuration values are available:
Prop | Type | Description | Default | Since |
---|---|---|---|---|
enable | boolean | Configure whether the plugin should be enabled from startup. Only available for Android and iOS. | true | |
imageName | string | Configure whether the plugin should display a custom image from assets instead of a default background gray for the privacy screen. Only available for iOS. | "" | |
contentMode | 'center' | 'scaleToFill' | 'scaleAspectFit' | 'scaleAspectFill' | Configure the content mode of displayed image. Only available for iOS. | "center" | |
preventScreenshots | boolean | Configure whether the plugin should prevent screenshots if enabled. Only available for iOS. | true | 5.2.0 |
In capacitor.config.json
:
1{ 2 "plugins": { 3 "PrivacyScreen": { 4 "enable": true, 5 "imageName": "Splashscreen", 6 "contentMode": "scaleAspectFit", 7 "preventScreenshots": false 8 } 9 } 10}
In capacitor.config.ts
:
1/// <reference types="@capacitor-community/privacy-screen" /> 2 3import { CapacitorConfig } from '@capacitor/cli'; 4 5const config: CapacitorConfig = { 6 plugins: { 7 PrivacyScreen: { 8 enable: true, 9 imageName: "Splashscreen", 10 contentMode: "scaleAspectFit", 11 preventScreenshots: false, 12 }, 13 }, 14}; 15 16export default config;
A working example can be found here: robingenz/capacitor-plugin-demo
The plugin only needs to be installed. The protection is enabled by default.
However, you have the option to enable/disable the protection:
1import { PrivacyScreen } from '@capacitor-community/privacy-screen'; 2 3const enable = async () => { 4 await PrivacyScreen.enable(); 5}; 6 7const disable = async () => { 8 await PrivacyScreen.disable(); 9};
1enable() => Promise<void>
Enables the privacy screen protection.
Only available for Android and iOS.
Since: 1.1.0
1disable() => Promise<void>
Disables the privacy screen protection.
Only available for Android and iOS.
Since: 1.1.0
1addListener(eventName: 'screenRecordingStarted', listenerFunc: () => void) => Promise<PluginListenerHandle>
Called when the screen recording is started.
Only available on iOS for now.
Param | Type |
---|---|
eventName | 'screenRecordingStarted' |
listenerFunc | () => void |
Returns: Promise<PluginListenerHandle>
Since: 3.0.2
1addListener(eventName: 'screenRecordingStopped', listenerFunc: () => void) => Promise<PluginListenerHandle>
Called when the screen recording is stopped.
Only available on iOS for now.
Param | Type |
---|---|
eventName | 'screenRecordingStopped' |
listenerFunc | () => void |
Returns: Promise<PluginListenerHandle>
Since: 3.0.2
1addListener(eventName: 'screenshotTaken', listenerFunc: () => void) => Promise<PluginListenerHandle>
Called when the screenshot is taken.
Only available on iOS for now.
Param | Type |
---|---|
eventName | 'screenshotTaken' |
listenerFunc | () => void |
Returns: Promise<PluginListenerHandle>
Since: 3.2.0
1removeAllListeners() => Promise<void>
Remove all listeners for this plugin.
Since: 3.0.2
Prop | Type |
---|---|
remove | () => Promise<void> |
See CHANGELOG.md.
See LICENSE.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
binaries present in source code
Details
Reason
1 existing vulnerabilities detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 4
Details
Reason
Found 10/30 approved changesets -- score normalized to 3
Reason
0 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More