시작하기
__CAPGO_KEEP_1__를 설정하기 위한 지시문을 복사하세요.
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_KEEP_8__
__CAPGO_KEEP_9__bun add @capgo/capacitor-volume-buttonsbunx cap syncimport { VolumeButtons } from '@capgo/capacitor-volume-buttons';API 개요
'API 개요' 제목의 섹션addListener
'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
'removeAllListeners' 제목의 섹션이 플러그인의 모든 리스너를 제거합니다.
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;}VolumeButtonDirection
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.