はじめに
このプラグインのインストール手順とフルマークダウンガイドを含むセットアップ用の質問をコピーしてください。
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.
__CAPGO_KEEP_0__
__CAPGO_KEEP_0__AI-Assisted セットアップを使用してプラグインをインストールすることができます。AIツールに Capgo スキルを追加するには、以下のコマンドを実行してください。
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins次に、以下のプロンプトを使用してください。
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-android-kiosk` plugin in my project.手動セットアップを使用する場合は、以下のコマンドを実行してプラグインをインストールし、以下のプラットフォーム固有の指示に従ってください。
bun add @capgo/capacitor-android-kioskbunx cap syncインポート
「インポート」セクションimport { CapacitorAndroidKiosk } from '@capgo/capacitor-android-kiosk';API の概要
「API の概要」セクションisInKioskMode
「isInKioskMode」セクションアプリが現在キオスクモードで実行されているかを確認します。
import { CapacitorAndroidKiosk } from '@capgo/capacitor-android-kiosk';
const { isInKioskMode } = await CapacitorAndroidKiosk.isInKioskMode();console.log('Kiosk mode active:', isInKioskMode);isSetAsLauncher
「isSetAsLauncher」セクションアプリがデバイスのホームアプリとして設定されているかを確認します。
import { CapacitorAndroidKiosk } from '@capgo/capacitor-android-kiosk';
const { isLauncher } = await CapacitorAndroidKiosk.isSetAsLauncher();console.log('Is launcher:', isLauncher);enterKioskMode
Section titled “enterKioskMode”キオスクモードに切り替えます。システムUIとハードウェアボタンの非表示、システムによってアプリが殺される可能性を低くします。 この機能が有効になるためには、このアプリをデバイスの起動画面に設定する必要があります。
import { CapacitorAndroidKiosk } from '@capgo/capacitor-android-kiosk';
await CapacitorAndroidKiosk.enterKioskMode();exitKioskMode
Section titled “exitKioskMode”キオスクモードを終了し、通常のシステムUIとハードウェアボタンの機能を復元します。 キオスクモードに切り替えたときに開始した前景キープアライブサービスも停止します。
import { CapacitorAndroidKiosk } from '@capgo/capacitor-android-kiosk';
await CapacitorAndroidKiosk.exitKioskMode();console.log('Exited kiosk mode');setAsLauncher
Section titled “setAsLauncher”このアプリを起動画面に設定するためのデバイスのホーム画面設定を開きます。 キオスクモードの完全な機能を使用するには、この設定が必要です。
import { CapacitorAndroidKiosk } from '@capgo/capacitor-android-kiosk';
await CapacitorAndroidKiosk.setAsLauncher();// User will be prompted to select this app as the home appsetAllowedKeys
Section titled “setAllowedKeys”キオスクモードで機能するハードウェアキーのセットを設定します。 デフォルトでは、キオスクモードではすべてのハードウェアキーの機能がブロックされます。
import { CapacitorAndroidKiosk } from '@capgo/capacitor-android-kiosk';
// Allow volume keys onlyawait CapacitorAndroidKiosk.setAllowedKeys({ volumeUp: true, volumeDown: true, back: false, home: false, recent: false});Type Reference
タイプ リファレンスEnterKioskModeOptions
Section titled “EnterKioskModeOptions”キオスクモードのオプション 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
Section titled “AllowedKeysOptions”キオスクモードで許可されたハードウェアキーの設定
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 Of Truth
ソース オブ トゥースSection titled “Source Of Truth” src/definitions.tsこのページはプラグインのソースから生成されています。 . API のパブリック リソースがアップストリームで変更された場合に再度 Sync を実行してください。
Getting Startedから続けてください
Getting Startedから続けてくださいCapgoを使用している場合 Getting Started Capgoを使用してダッシュボードとAPIの操作を計画するには、CapgoをAPI/__CAPGO_KEEP_1__-android-kiosk Capgoを使用してCapgoのネイティブ機能を実装するには、@capgo/capacitor-android-kioskを使用します。 for the native capability in Using @capgo/capacitor-android-kiosk, API Overview for the implementation detail in API Overview, Capgoの実装詳細については、Capgoの概要を参照してください。 Capgoの概要 API Keys APIの実装詳細については、 デバイス __CAPGO_KEEP_0__の実装詳細については、