메뉴로 이동

Getting Started

GitHub

설치

설치

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

removeAllListeners

제목 'removeAllListeners'

이 플러그인의 모든 리스너를 제거합니다.

import { VolumeButtons } from '@capgo/capacitor-volume-buttons';
await VolumeButtons.removeAllListeners();

자연 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';

이 페이지는 플러그인의 __CAPGO_KEEP_0__에서 생성되었습니다. upstream에서 pubic이 변경되면 다시 싱크를 실행하세요. src/definitions.ts. Re-run the sync when the public API changes upstream.

Section titled “Keep going from Getting Started”

protectedTokens

Capgo를 사용 중이라면 Getting Started 대시보드와 API 연산을 계획하고 연결하려면 Capacitor의 @capgo/capacitor-volume-buttons를 사용 Capacitor의 @capgo/capacitor-volume-buttons를 사용하는 데 native capability이 필요합니다. API 개요 API Overview의 implementation detail을 참조하세요. 소개 소개의 implementation detail을 참조하세요. API 키 API Keys의 implementation detail을 참조하세요. 장치 __CAPGO_KEEP_0__ 구현 세부 사항입니다.