@radarsoft/capacitor-privacy-screen
v1.0.2
Published
Privacy screen plugin that covers the app in the app switcher / on minimize, without blocking screenshots or screen recording on Android.
Downloads
483
Readme
@radarsoft/capacitor-privacy-screen
Capacitor plugin that covers the app content in the app switcher and while backgrounded, without blocking screenshots or screen recording on Android.
Repository: github.com/RadarCZ/capacitor-privacy-screen
Install
npm install @radarsoft/capacitor-privacy-screen
npx cap syncAPI
import { PrivacyScreen } from '@radarsoft/capacitor-privacy-screen';
await PrivacyScreen.enable({
android: {
dimBackground: true,
privacyModeOnActivityHidden: 'splash'
},
ios: {
blurEffect: 'dark'
}
});
await PrivacyScreen.disable();
const { enabled } = await PrivacyScreen.isEnabled();enable(config?: PrivacyScreenConfig): Promise<{ success: boolean }>
Enables privacy screen protection.
android.dimBackground(boolean, defaultfalse) — whentrue, dims the app content instead of showing the splash screen while the privacy screen is displayed.android.privacyModeOnActivityHidden('none' | 'dim' | 'splash', default'none') — controls what's shown when the activity is hidden (e.g. a system dialog like a biometric prompt).ios.blurEffect('light' | 'dark' | 'none', default'none') — when'light'or'dark', blurs the snapshot iOS takes of the app when it moves to the background, so sensitive content isn't visible in the app switcher.
disable(): Promise<{ success: boolean }>
Disables privacy screen protection.
isEnabled(): Promise<{ enabled: boolean }>
Returns whether privacy screen protection is currently enabled.
Platforms
- iOS —
ios/Plugin/PrivacyScreenPlugin.swift - Android —
android/src/main/java/cz/radarsoft/privacyscreen/ - Web — no-op (native-only plugin)
License
MIT
