Getting Started
このプラグインのインストール手順とフルマークダウンガイドを含むセットアッププロンプトをコピーしてください。
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-volume-buttons`
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/volume-buttons/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のAIアシストセットアップを使用してプラグインをインストールできます。次のコマンドを使用して、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 Setupを使用する場合は、次のコマンドを実行して、以下のプラットフォーム固有の指示に従ってください。
bun add @capgo/capacitor-volume-buttonsbunx cap syncImport
「Import」のセクションimport { VolumeButtons } from '@capgo/capacitor-volume-buttons';addListener
Section titled “addListener”ハードウェアボリュームボタンの押下を検知する。
import { VolumeButtons } from '@capgo/capacitor-volume-buttons';
const listener = await VolumeButtons.addListener( 'volumeButtonPressed', (event) => { console.log(`Volume ${event.direction} button pressed`); });
// Remove listener when doneawait listener.remove();removeAllListeners
Section titled “removeAllListeners”このプラグインのすべてのリスナーを削除します。
import { VolumeButtons } from '@capgo/capacitor-volume-buttons';
await VolumeButtons.removeAllListeners();getPluginVersion
Section titled “getPluginVersion”ネイティブのCapacitorプラグインのバージョンを取得します。
import { VolumeButtons } from '@capgo/capacitor-volume-buttons';
const { version } = await VolumeButtons.getPluginVersion();console.log('Plugin version:', version);VolumeButtonListener
ボリュームボタンリスナーボリュームボタンイベントのリスナー関数。
export type VolumeButtonListener = (event: VolumeButtonPressed) => void;VolumeButtonPressed
ボリュームボタン押下ボリュームボタン押下イベントのデータ。
export interface VolumeButtonPressed { /** Direction of the button press */ direction: VolumeButtonDirection;}VolumeButtonDirection
ボリュームボタン方向ボリュームボタン押下の方向。
export type VolumeButtonDirection = 'up' | 'down';真実の源
真実の源このページはプラグインのソースコードから生成されています。 src/definitions.ts. APIを再度同期するには、上流でAPIが変更されたときに再度同期してください。
Getting Startedから続けてください。
Getting Startedから続けてください。あなたが「Getting Started」を使用してダッシュボードと__CAPGO_KEEP_0__の操作を計画している場合、__CAPGO_KEEP_0__を__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-volume-buttonsと接続してください。 Getting Started Using @API/__CAPGO_KEEP_1__-volume-buttons Using @capgo/capacitor-volume-buttons for the native capability in Using @capgo/capacitor-volume-buttons, API Overview for the implementation detail in API Overview, Introduction __CAPGO_KEEP_0__ API キー 実装詳細の API キーについて デバイス 実装詳細のデバイスについて