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-community/in-app-review
Lets you prompt users to submit app store ratings and reviews without leaving your app - using platform native dialogs.
@capacitor/preferences
The Preferences API provides a simple key/value persistent store for lightweight data.
@capacitor-community/screen-brightness
control screen brightness on ios and android
@capacitor-community/keep-awake
Prevent your screen from getting some sleep!
npm install @capacitor-community/privacy-screen
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
88 Stars
134 Commits
23 Forks
9 Watching
2 Branches
27 Contributors
Updated on 25 Nov 2024
Swift (49.91%)
Java (21.47%)
TypeScript (17.54%)
Ruby (4.92%)
Objective-C (3.75%)
JavaScript (2.41%)
Cumulative downloads
Total Downloads
Last day
-20.2%
1,157
Compared to previous day
Last week
-0.7%
6,982
Compared to previous week
Last month
12.6%
35,779
Compared to previous month
Last year
54.3%
229,566
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/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
3 existing vulnerabilities detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 4
Details
Reason
Found 11/30 approved changesets -- score normalized to 3
Reason
0 commit(s) and 2 issue activity found in the last 90 days -- score normalized to 1
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
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 2024-11-25
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