@capgo/capacitor-webview-guardian
Overview
Section titled “Overview”Detect when the WebView was killed in the background and relaunch it on foreground
Start with startMonitoring() and the other core methods listed below.
Platform support
Section titled “Platform support”| Platform | Support | Notes |
|---|---|---|
| iOS | Yes | Native |
| Android | Yes | Native |
| Web | No | Guard with Capacitor.getPlatform() |
Core Capabilities
Section titled “Core Capabilities”startMonitoring- Starts observing foreground events and automatically checks the WebView health.stopMonitoring- Stops any automatic foreground monitoring.getState- Returns the latest known monitoring state.checkNow- Forces a WebView health probe immediately.
Public API
Section titled “Public API”| Method | Description |
|---|---|
startMonitoring | Starts observing foreground events and automatically checks the WebView health. |
stopMonitoring | Stops any automatic foreground monitoring. |
getState | Returns the latest known monitoring state. |
checkNow | Forces a WebView health probe immediately. |
addListener | See the source definitions for current behavior. |
Source Of Truth
Section titled “Source Of Truth”This reference is synced from src/definitions.ts in capacitor-webview-guardian.
Keep going from @capgo/capacitor-webview-guardian
Section titled “Keep going from @capgo/capacitor-webview-guardian”If you are using @capgo/capacitor-webview-guardian to plan native media and interface behavior, connect it with Using @capgo/capacitor-webview-guardian for the native capability in Using @capgo/capacitor-webview-guardian, Using @capgo/capacitor-live-activities for the native capability in Using @capgo/capacitor-live-activities, @capgo/capacitor-live-activities for the implementation detail in @capgo/capacitor-live-activities, Using @capgo/capacitor-video-player for the native capability in Using @capgo/capacitor-video-player, and @capgo/capacitor-video-player for the implementation detail in @capgo/capacitor-video-player.