Vai al contenuto

Getting Started

Questo contenuto non è ancora disponibile nella tua lingua.

  1. Install the plugin

    Terminal window
    npm i @capgo/capacitor-privacy-screen
  2. Sync native platforms

    Terminal window
    npx cap sync
  3. Review platform 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.
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);

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().