컨텐츠로 바로가기

시작하기

__CAPGO_KEEP_8__

__CAPGO_KEEP_9__
터미널 창
bun add @capgo/capacitor-volume-buttons
bunx cap sync
import { VolumeButtons } from '@capgo/capacitor-volume-buttons';

하드웨어 볼륨 버튼의 눌림을 감지합니다.

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

getPluginVersion

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

볼륨 버튼 누르기 방향.

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

이 페이지는 플러그인의 src/definitions.ts. upstream에서 변경된 public API를 다시 동기화할 때.

Getting Started에서 계속

Getting Started에서 계속 섹션 제목

Capgo를 사용 중이라면 Getting Started 를 사용하여 대시보드와 API를 계획하고 운영할 수 있습니다. Capgo를 연결하세요. 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 for the implementation detail in Introduction API Keys for the implementation detail in API Keys, and Devices for the implementation detail in Devices.