__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 の概要

APIの概要

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

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();

Get the native Capacitor plugin version.

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. API を再度同期するには、上流で API が変更されたときに再度同期してください。

続けて "Getting Started" から進みます。

「続けて "Getting Started" から進みます。」

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