@capgo/capacitor-볼륨 버튼 사용
Capacitor 볼륨 버튼 플러그인: 하드웨어 볼륨 버튼 누름 감지
설치
bun add @capgo/capacitor-volume-buttons
bunx cap sync
이 플러그인이 제공하는 기능
addListener- 하드웨어 볼륨 버튼 누름 감지removeAllListeners- 이 플러그인에 대한 모든 리스너 제거getPluginVersion- 네이티브 Capacitor 플러그인 버전 가져오기
사용 예
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 done
await listener.remove();
removeAllListeners
- 이 플러그인에 대한 모든 리스너 제거
import { VolumeButtons } from '@capgo/capacitor-volume-buttons';
await VolumeButtons.removeAllListeners();
getPluginVersion
- 네이티브 Capacitor 플러그인 버전 가져오기
import { VolumeButtons } from '@capgo/capacitor-volume-buttons';
const { version } = await VolumeButtons.getPluginVersion();
console.log('Plugin version:', version);
전체 참조
- GitHub: https://github.com/Cap-go/capacitor-volume-buttons/
- 문서: /docs/plugins/volume-buttons/
Using @capgo/capacitor-volume-buttons
이러한 기능을 사용 중이라면 Using @capgo/capacitor-volume-buttons @__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-volume-buttons @capgo/capacitor-volume-buttons @capgo/capacitor-volume-buttons 의 구현 세부 사항을 참조하세요. Getting Started Capgo Plugin Directory Capgo 제품 워크플로우에 대한 Capgo 플러그인 디렉토리 Capacitor Plugins by Capgo for the implementation detail in Capacitor Plugins by Capgo, and Capgo 플러그인 Capgo 플러그인에 대한 구현 세부 정보, Adding or Updating Plugins