Démarrage
Copier un prompt de configuration avec les étapes d'installation et la guide markdown complète pour ce plugin.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-android-kiosk`
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/android-kiosk/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.
Installer
Section intitulée “Installer”bun add @capgo/capacitor-android-kioskbunx cap syncImporter
Section intitulée “Importer”import { CapacitorAndroidKiosk } from '@capgo/capacitor-android-kiosk';API Vue d'ensemble
Section intitulée “API Vue d'ensemble”isInKioskMode
Section intitulée “isInKioskMode”Vérifie si l'application est actuellement exécutée en mode kiosque.
import { CapacitorAndroidKiosk } from '@capgo/capacitor-android-kiosk';
const { isInKioskMode } = await CapacitorAndroidKiosk.isInKioskMode();console.log('Kiosk mode active:', isInKioskMode);isSetAsLauncher
Section intitulée “isSetAsLauncher”Vérifie si l'application est définie comme l'application de démarrage du dispositif (application d'accueil).
import { CapacitorAndroidKiosk } from '@capgo/capacitor-android-kiosk';
const { isLauncher } = await CapacitorAndroidKiosk.isSetAsLauncher();console.log('Is launcher:', isLauncher);enterKioskMode
Section intitulée “enterKioskMode”Active le mode kiosque, masquant l'interface utilisateur système et bloquant les boutons matériel.
import { CapacitorAndroidKiosk } from '@capgo/capacitor-android-kiosk';
await CapacitorAndroidKiosk.enterKioskMode();exitKioskMode
Sous-section intitulée « sortirDuModeKiosque »Sortir du mode kiosque, restaurant l'interface utilisateur système normale et la fonctionnalité des boutons matériel.
import { CapacitorAndroidKiosk } from '@capgo/capacitor-android-kiosk';
await CapacitorAndroidKiosk.exitKioskMode();console.log('Exited kiosk mode');setAsLauncher
Sous-section intitulée « setEnTêteDApp »Ouvre l'écran d'accueil du dispositif pour permettre à l'utilisateur de définir cette application en tant que lanceur.
import { CapacitorAndroidKiosk } from '@capgo/capacitor-android-kiosk';
await CapacitorAndroidKiosk.setAsLauncher();// User will be prompted to select this app as the home appsetAllowedKeys
Copier dans le presse-papierSous-section intitulée « setClésAutorisées »
import { CapacitorAndroidKiosk } from '@capgo/capacitor-android-kiosk';
// Allow volume keys onlyawait CapacitorAndroidKiosk.setAllowedKeys({ volumeUp: true, volumeDown: true, back: false, home: false, recent: false});Par défaut, toutes les clés matérielles sont bloquées en mode kiosque.
Référence de typeEnterKioskModeOptions
Options d'entrée de mode kiosqueDrapeaux optionnels pour enterKioskMode.
export interface EnterKioskModeOptions { /** * After reboot, start the app so you can call `enterKioskMode()` again. Best-effort only (OEM * behavior, force-stop). Omit to keep the saved value. Cleared when you call `exitKioskMode()`. */ restoreAfterReboot?: boolean;
/** * Periodically tries to bring the app to the foreground. Skipped while the screen is off. Often * blocked from the background on some devices—being the default launcher, relaxing battery limits, * and allowing exact alarms (where required) improve odds. Omit to keep the saved value. */ relaunch?: boolean;
/** Minutes between relaunch attempts when `relaunch` is on. Range 5–60; default 15. */ relaunchIntervalMinutes?: number;}AllowedKeysOptions
Options pour les clés de matériel autorisées en mode kiosqueOptions de configuration pour les clés de matériel autorisées en mode kiosque.
export interface AllowedKeysOptions { /** * Allow volume up button * @default false */ volumeUp?: boolean;
/** * Allow volume down button * @default false */ volumeDown?: boolean;
/** * Allow back button * @default false */ back?: boolean;
/** * Allow home button * @default false */ home?: boolean;
/** * Allow recent apps button * @default false */ recent?: boolean;
/** * Allow power button * @default false */ power?: boolean;
/** * Allow camera button (if present) * @default false */ camera?: boolean;
/** * Allow menu button (if present) * @default false */ menu?: boolean;}Source de vérité
Section intitulée « Source de vérité »Cette page est générée à partir du plugin's src/definitions.tsRe-run la synchronisation lorsque les public API changent en amont.