시작하기
이 플러그인의 설치 단계와 전체 마크다운 가이드를 포함한 설정 지시를 복사하세요.
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-Assisted Setup을 사용하여 플러그인을 설치할 수 있습니다. 다음 명령어를 사용하여 AI 도구에 Capgo 기능을 추가하세요:
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';API 개요
Section titled “API 개요”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. API 다시同步할 때 upstream에서 변경된 API가 변경되면 다시 동기화하세요.
Getting Started에서 계속
Getting Started에서 계속하기만약 __CAPGO_KEEP_0__를 사용하고 있다면 Getting Started API와 API를 연결하여 API와 __CAPGO_KEEP_1__를 계획하고 API를 운영하세요. Using @capgo/capacitor-volume-buttons Using @capgo/capacitor-volume-buttons를 사용하여 capgo의 네이티브 기능을 사용하세요. API Overview API Overview를 사용하여 API의 구현 세부 사항을 확인하세요. Introduction Introduction을 사용하여 __CAPGO_KEEP_0__의 구현 세부 사항을 확인하세요. API 키 API 키의 구현 세부 정보를 위해 장치 장치의 구현 세부 정보를 위해