시작하기
이 플러그인의 설치 단계와 전체 마크다운 가이드를 포함한 설정 지시를 복사하세요.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-webview-guardian`
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/webview-guardian/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-webview-guardianbunx cap syncimport
설정 제목 “import”import { WebviewGuardian } from '@capgo/capacitor-webview-guardian';API 개요
설정 제목 “API 개요”startMonitoring
설정 제목 “startMonitoring”앞면 이벤트를 관찰하고 자동으로 WebView의 건강을 확인합니다.
import { WebviewGuardian } from '@capgo/capacitor-webview-guardian';
await WebviewGuardian.startMonitoring();stopMonitoring
‘stopMonitoring’ 섹션자동 전면 모니터링을 중지합니다.
import { WebviewGuardian } from '@capgo/capacitor-webview-guardian';
await WebviewGuardian.stopMonitoring();getState
‘getState’ 섹션최신 모니터링 상태를 반환합니다.
import { WebviewGuardian } from '@capgo/capacitor-webview-guardian';
await WebviewGuardian.getState();checkNow
WebView의 즉시 건강 검사를 강제합니다.클립보드 복사
import { WebviewGuardian } from '@capgo/capacitor-webview-guardian';
await WebviewGuardian.checkNow();‘Type Reference’ 섹션
클립보드 복사StartMonitoringOptions
StartMonitoringOptionsexport interface StartMonitoringOptions { /** * Delay (in ms) before running a health check after the app re-enters the foreground. * Defaults to 600ms to let the bridge finish resuming. */ foregroundDebounceMs?: number;
/** * Script executed via `evaluateJavascript`/`evaluateJavaScript` to confirm the WebView is alive. * Defaults to `document.readyState`. */ pingScript?: string;
/** * Automatically reloads the WebView when a terminated render process is detected. * Disable to receive `webviewCrashed` events and restart manually. */ autoRestart?: boolean;
/** * Strategy used when restarting the WebView. Defaults to `reload`. */ restartStrategy?: RestartStrategy;
/** * Custom HTTPS/HTTP URL to load when `restartStrategy` is `customUrl`. */ customRestartUrl?: string;
/** * Emits verbose logging in the native layer when true. */ debug?: boolean;
/** * Whether an immediate health check should be executed right after enabling monitoring. * Defaults to `true`. */ runInitialCheck?: boolean;}GuardianState
GuardianStateexport interface GuardianState { monitoring: boolean; reason: string; timestamp: string; lastHealthyAt?: string; lastRestartAt?: string; lastCrashAt?: string; pendingRestartReason?: string; error?: string;}CheckNowOptions
CheckNowOptionsexport interface CheckNowOptions { /** * Text tag describing why a manual check is being requested. */ reason?: string;}CheckResult
CheckResultexport interface CheckResult { healthy: boolean; restarted: boolean; reason: string; timestamp: string; error?: string; pendingRestart?: boolean;}GuardianEvent
GuardianEventexport type GuardianEvent = GuardianState;RestartStrategy
RestartStrategyexport type RestartStrategy = 'reload' | 'reloadFromOrigin' | 'customUrl';원본
원본이 페이지는 플러그인의 src/definitions.ts업스트림에서 API이 변경될 때 다시 싱크를 실행하세요.
Getting Started에서 계속
Getting Started에서 계속이러한 기능을 사용 중이라면 Getting Started 자연스러운 미디어 및 인터페이스 동작을 계획하려면 Using @capgo/capacitor-webview-guardian Using @capgo/capacitor-webview-guardian Using @capgo/capacitor-live-activities capgo의 원생 기능을 위한 Using @capacitor/__CAPGO_KEEP_2__-live-activities, @capgo/capacitor-live-activities capgo의 구현 세부사항을 위한 @capacitor/__CAPGO_KEEP_2__-live-activities, Using @capgo/capacitor-video-player capgo의 원생 기능을 위한 Using @capacitor/__CAPGO_KEEP_2__-video-player, and @capgo/capacitor-video-player capgo의 구현 세부사항을 위한 @capacitor/__CAPGO_KEEP_2__-video-player.