Install @__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-android-kiosk and start using its current __CAPGO_KEEP_2__ __CAPGO_KEEP_3__. - __CAPGO_KEEP_4__ アプリのリアルタイム更新管理はストアの手間なく、...

Getting Started

GitHub

CapgoのAIアシストセットアップを使用してプラグインをインストールできます。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.

Manualセットアップを使用する場合は、以下のコマンドを実行してプラグインをインストールし、以下のプラットフォーム固有の指示に従ってください。

ターミナル画面
bun add @capgo/capacitor-android-kiosk
bunx cap sync
import { CapacitorAndroidKiosk } from '@capgo/capacitor-android-kiosk';

Checks if the app is currently running in kiosk mode.

import { CapacitorAndroidKiosk } from '@capgo/capacitor-android-kiosk';
const { isInKioskMode } = await CapacitorAndroidKiosk.isInKioskMode();
console.log('Kiosk mode active:', isInKioskMode);

Checks if the app is set as the device launcher (home app).

import { CapacitorAndroidKiosk } from '@capgo/capacitor-android-kiosk';
const { isLauncher } = await CapacitorAndroidKiosk.isSetAsLauncher();
console.log('Is launcher:', isLauncher);

__CAPGO_KEEP_0__モードに入り、システムUIとハードウェアボタンのブロックを実行します。 また、前景のキープアライブサービスを開始するので、システムによってアプリが殺される可能性が低くなります。 この機能が効果的に動作するには、アプリをデバイスの起動アプリとして設定する必要があります。

import { CapacitorAndroidKiosk } from '@capgo/capacitor-android-kiosk';
await CapacitorAndroidKiosk.enterKioskMode();

__CAPGO_KEEP_0__モードから脱出、通常のシステムUIとハードウェアボタンの機能を復元します。 また、enterKioskMode()で開始した前景のキープアライブサービスを停止します。

import { CapacitorAndroidKiosk } from '@capgo/capacitor-android-kiosk';
await CapacitorAndroidKiosk.exitKioskMode();
console.log('Exited kiosk mode');

デバイスのホーム画面設定を開き、ユーザーがこのアプリを起動アプリとして設定できるようにします。 これは、フル機能の__CAPGO_KEEP_0__モードのために必要です。

import { CapacitorAndroidKiosk } from '@capgo/capacitor-android-kiosk';
await CapacitorAndroidKiosk.setAsLauncher();
// User will be prompted to select this app as the home app

__CAPGO_KEEP_0__モードで機能するハードウェアキーのセットを設定します。 デフォルトでは、__CAPGO_KEEP_0__モードではすべてのハードウェアキーのブロックが実行されます。

import { CapacitorAndroidKiosk } from '@capgo/capacitor-android-kiosk';
// Allow volume keys only
await CapacitorAndroidKiosk.setAllowedKeys({
volumeUp: true,
volumeDown: true,
back: false,
home: false,
recent: false
});

タイプ リファレンス

タイプ参照

オプション 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

許可されたキー

キオスクモードで許可されたハードウェアキーの設定オプション

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;
}

真実の源

真実の源

このページはプラグインの src/definitions.tsパブリックAPIがアップストリームで変更されたときに再度同期してください。

はじめから始める

「Getting Started」から続けて

あなたが「を使用している場合 Getting Started ダッシュボードとAPIの作業を計画するには、を接続してください native capabilityのために、@capgo/capacitor-android-kiosk native capabilityのために、@capgo/capacitor-android-kiosk APIの概要 APIの実装詳細 Introduction __CAPGO_KEEP_0__の実装詳細 APIのキー APIの実装詳細 デバイス デバイスの実装詳細について