Android Setup
Questo contenuto non è ancora disponibile nella tua lingua.
This plugin is Android-first and performs native WebView provider version checks.
Android support matrix
Section titled “Android support matrix”- API 22+ (Android 5.1 or later)
- Android 5-6 and 10+: Android System WebView provider
- Android 7-9: Google Chrome provider
Default behavior (main use case)
Section titled “Default behavior (main use case)”The default mode is Browserslist-style compatibility:
minimumDeviceSharePercentdefaults to3- dataset is bundled at build time from caniuse data
- no runtime dataset URL call is required unless you set
versionShareApiUrl
import type { CapacitorConfig } from '@capacitor/cli';
const config: CapacitorConfig = { plugins: { WebviewVersionChecker: {}, },};
export default config;Basic plugin config
Section titled “Basic plugin config”import type { CapacitorConfig } from '@capacitor/cli';
const config: CapacitorConfig = { plugins: { WebviewVersionChecker: { autoPromptOnOutdated: true, }, },};
export default config;Advanced threshold mode (custom dataset)
Section titled “Advanced threshold mode (custom dataset)”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, }, }, },};
export default config;versionShareByMajor explanation:
- key = major WebView version (example
137) - value = share percent (
0..100) minimumDeviceSharePercent: 3means “compatible only if current major version >= 3% share in the dataset”
You can also provide the dataset through versionShareApiUrl with:
{ "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 }] }