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.
インストール
「インストール」のセクション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-buttonsbunx cap syncImport
「Import」セクションimport { VolumeButtons } from '@capgo/capacitor-volume-buttons';API オーバービュー
Section titled “API Overview”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
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 キーについて デバイス デバイスの実装詳細について