跳过内容

开始使用

GitHub

您可以使用我们的AI辅助设置来安装插件。使用以下命令将Capgo技能添加到您的AI工具中:

终端窗口
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins

然后使用以下提示:

Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-privacy-screen` plugin in my project.

如果您更喜欢手动设置,请按照以下命令安装插件,并遵循以下平台特定的说明:

  1. 安装插件

    终端窗口
    bun add @capgo/capacitor-privacy-screen
  2. 同步本机平台

    终端窗口
    bunx cap sync
  3. 查看平台行为

    • 阅读 iOS注意事项 用于应用切换行为。
    • 阅读 context HTML text fragment from a longer Capgo UI string (parent key `read_the_style_guide`). Page/area: Capgo marketing website. Role: Website copy sentence. Seen in: page contributing.astro. Message key `read_the_style_guide` (Read The Style Guide).

默认行为

  • Section titled “Default behavior”
  • 插件在原生实现加载时自动启用隐私保护。
  • On Web, the plugin keeps an in-memory enabled flag only for API parity.

在iOS上,插件在应用切换快照生成时隐藏您的应用程序。

基本使用
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() 例如,需要用户截图的账户验证步骤

  • 需要可见的应用切换预览的支付或身份提供商流程
  • 在信任设备上的受控调试会话
  • 立即恢复保护

继续从 Getting Started enable().

继续从 Getting Started

什么时候暂时禁用

如果您正在使用 开始使用 来规划安全性和合规性,连接它与 使用@capgo/capacitor-隐私屏幕 for the native capability in Using @capgo/capacitor-privacy-screen, 用于实现细节的 用于实现细节的 __CAPGO_KEEP_0__安全扫描器 用于__CAPGO_KEEP_0__安全扫描器的产品工作流程,并 Capgo安全 for the product workflow in Capgo Security Scanner, and Capgo Security 为Capgo安全产品流程。