__CAPGO_KEEP_2__

Getting Started

GitHub

AI-Assisted セットアップを使用してプラグインをインストールできます。次のコマンドを使用して、Capgo スキルをAIツールに追加します。

ターミナル画面
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-volume-buttons` plugin in my project.

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

ターミナル画面
bun add @capgo/capacitor-volume-buttons
bunx cap sync
import { VolumeButtons } from '@capgo/capacitor-volume-buttons';

API オーバービュー

Section titled “API Overview”

ハードウェアのボリュームボタンの押下を検知する。

import { VolumeButtons } from '@capgo/capacitor-volume-buttons';
const listener = await VolumeButtons.addListener(
'volumeButtonPressed',
(event) => {
console.log(`Volume ${event.direction} button pressed`);
}
);
// Remove listener when done
await listener.remove();

このプラグインのすべてのリスナーを削除します。

import { VolumeButtons } from '@capgo/capacitor-volume-buttons';
await VolumeButtons.removeAllListeners();

ネイティブのCapacitorプラグインのバージョンを取得します。

import { VolumeButtons } from '@capgo/capacitor-volume-buttons';
const { version } = await VolumeButtons.getPluginVersion();
console.log('Plugin version:', version);

VolumeButtonListener

VolumeButtonListener

ボリュームボタンのイベントリスナー

export type VolumeButtonListener = (event: VolumeButtonPressed) => void;

VolumeButtonPressed

VolumeButtonPressed

ボリュームボタン押下イベントデータ

export interface VolumeButtonPressed {
/** Direction of the button press */
direction: VolumeButtonDirection;
}

VolumeButtonDirection

VolumeButtonDirection

ボリュームボタンの押下方向

export type VolumeButtonDirection = 'up' | 'down';

元の情報源

元の情報源

このページはプラグインの src/definitions.ts. Cloudflare の API を再度同步するには、上流で API が変更されたときに再度実行してください。

Getting Started から続けてください。

Getting Started から続けてください。

「Getting Started から続けてください。」の場合、 Getting Started Capacitor を使用してダッシュボードと API の作業を計画するには、Capacitor を API に接続してください。 Capacitor の @capgo/capacitor-volume-buttons を使用して、Capacitor の @capgo/capacitor-volume-buttons のネイティブ機能を実装します。 Capacitor の @capgo/capacitor-volume-buttons の概要 Capacitor の @API/__CAPGO_KEEP_1__-volume-buttons の概要 Capacitor の @API/__CAPGO_KEEP_1__-volume-buttons の概要 Capacitor の @__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-volume-buttons の概要 Capacitor の @__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-volume-buttons の概要 API キー 実装詳細の API キーについて デバイス デバイスの実装詳細について