시작하기
설치 단계와 이 플러그인의 전체 마크다운 가이드를 포함한 설정 프롬프트를 복사하세요.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-webview-version-checker`
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-version-checker/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-version-checker -
자연어 프로젝트 동기화
터미널 창 bunx cap sync -
선택적: 플러그인 구성 추가 기본값으로 실행하거나 (
WebviewVersionChecker: {}) 커스터마이즈할 수 있는 프롬프트 및阈值 동작을 커스터마이즈할 수 있습니다.capacitor.config.ts.
기본 동작 (주요 사용 사례)
기본 동작 (주요 사용 사례)이 플러그인은 기본적으로 브라우저 목록 스타일의 호환성 규칙을 사용합니다.
minimumDeviceSharePercent기본값3- 공유 데이터 세트는 빌드 시 caniuse 데이터에서 패키징됩니다.
- 기본 흐름에서 런타임 데이터 세트 URL 호출이 필요하지 않습니다.
import type { CapacitorConfig } from '@capacitor/cli';
const config: CapacitorConfig = { plugins: { WebviewVersionChecker: {}, },};
export default config;단순한 구성만 설정하는 방법 (자연스러운 프롬프트)
클립보드 복사import type { CapacitorConfig } from '@capacitor/cli';
const config: CapacitorConfig = { plugins: { WebviewVersionChecker: { autoPromptOnOutdated: true, }, },};
export default config;import type { CapacitorConfig } from '@capacitor/cli';
const config: CapacitorConfig = { plugins: { WebviewVersionChecker: { minimumDeviceSharePercent: 3, versionShareByMajor: { '137': 58.2, '136': 21.3, '135': 4.6, '134': 2.1, }, autoPromptOnOutdated: true, }, },};
export default config;실제 세계 공유에 기반한 호환성을만드는 것 대신에 고정된 버전만으로만 하는 경우에만 사용하세요.
minimumDeviceSharePercent: 3설치된 주요 버전은 데이터 세트 내에서 최소 3%를 나타내야 합니다.versionShareByMajor당신의 커스텀 맵: 주요 버전 => 퍼센티지- 원격 데이터를 선호하는 경우에 사용하세요
versionShareApiUrl다음 중 하나와 함께:{ "versionShareByMajor": { "137": 54.2, "136": 23.8 } }{ "shareByMajor": { "137": 54.2, "136": 23.8 } }{ "versions": [{ "major": 137, "share": 54.2 }, { "version": "136.0.0.0", "percent": 23.8 }] }
JavaScript를 사용한 고급 사용
JavaScript를 사용한 고급 사용 섹션import { WebviewVersionChecker } from '@capgo/capacitor-webview-version-checker';
await WebviewVersionChecker.addListener('webViewOutdated', (status) => { console.log('Outdated WebView detected', status);});
await WebviewVersionChecker.check({ minimumMajorVersion: 124, showPromptOnOutdated: true,});이 플러그인을 사용하는 이유는 Capacitor 설정만으로는 무엇입니까
Section titled “Why use this plugin instead of only Capacitor config”Capacitor는 정적 최소 체크를 지원합니다:
android: { minWebViewVersion: 124,},server: { errorPath: 'unsupported-webview.html',}이 플러그인은 런타임 이벤트와 네이티브 프롬프트 UX를 추가하여 사용자가 업데이트를 권장받으면서도 앱을 여전히 열고 사용할 수 있도록 합니다.
평가 순서:
- 디바이스 공유 임계값 모드 (
minimumDeviceSharePercent+ 데이터 세트)가 제공된 경우 - 최신 버전 모드 (
latestVersion/latestVersionApiUrl) - 최소 주요 버전 fallback (
minimumMajorVersion)
Android 제공자 처리
제목이 “Android 제공자 처리”인 섹션Capacitor의 Android에서 사용하는 WebView 제공자 모델 모두를 지원합니다.
- Android 5-6 및 10+: Android System WebView (
com.google.android.webview) - Android 7-9: Google Chrome (
com.android.chrome)