Getting Started
复制一个包含安装步骤和此插件的完整Markdown指南的设置提示。
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.
-
安装插件
终端窗口 bun add @capgo/capacitor-privacy-screen -
同步本地平台
终端窗口 bunx cap sync -
Review platform 行为
- Read the iOS notes iOS app switcher 行为说明.
- Read the Android notes Android 截图和录屏行为说明.
Default behavior
Section titled “Default 行为”该插件在原生实现加载时自动启用隐私保护功能。
- 在 Android 上,安全模式阻止截图、屏幕录屏捕获和最近应用预览。
- 在 iOS 上,插件在 app switcher 快照生成时隐藏您的应用。
- 在 Web 上,插件仅在内存中启用标志API的奇数次方。
基本使用
标题为“基本使用”的部分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);何时临时禁用它
标题为“何时临时禁用它”的部分仅在当前屏幕应在系统预览中保持可见或由用户捕获时使用,例如: disable() 需要用户截图以获取支持的账户验证步骤
- 需要可见的应用切换器预览的支付或身份提供者流
- 在受信任设备上的受控调试会话
- 立即恢复保护后
__CAPGO_KEEP_0__ enable().
继续从 Getting Started
继续从 Getting Started 的部分如果您正在使用 Getting Started 来规划安全性和合规性,连接它与 使用 @capgo/capacitor-privacy-screen 为 native capability 在使用 @capgo/capacitor-privacy-screen 中 加密 为加密实现细节 合规 为合规实现细节 Capgo 安全扫描器 为产品工作流程在Capgo安全扫描器中 Capgo安全 为产品工作流程在Capgo安全