Getting Started
Copy a setup prompt with the install steps and the full markdown guide for this plugin.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-privacy-screen`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/privacy-screen/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
-
Install the plugin
Terminal window bun add @capgo/capacitor-privacy-screen -
Sync native platforms
Terminal window bunx cap sync -
Review platform behavior
- Read the iOS notes for app switcher behavior.
- Read the Android notes for screenshot and recording behavior.
Default behavior
Section titled “Default behavior”The plugin enables privacy protection automatically when the native implementation loads.
- On Android, secure mode blocks screenshots, screen recording capture, and the recent apps preview.
- On iOS, the plugin hides your app during app switcher snapshot generation.
- On Web, the plugin keeps an in-memory enabled flag only for API parity.
Basic usage
Section titled “Basic usage”import { PrivacyScreen } from '@capgo/capacitor-privacy-screen';
await PrivacyScreen.disable();
// Run a flow where screenshots or previews are temporarily allowed.
await PrivacyScreen.enable();
const { enabled } = await PrivacyScreen.isEnabled();console.log('Privacy screen enabled:', enabled);When to disable it temporarily
Section titled “When to disable it temporarily”Use disable() only when the current screen should remain visible in system previews or be capturable by the user, for example:
- account verification steps that require screenshots for support
- payment or identity-provider flows that need a visible app switcher preview
- controlled debugging sessions on trusted devices
Restore protection immediately afterward with enable().