도움말
볼륨 버튼에 대한 튜토리얼
볼륨 버튼을 사용하는 @capgo/capacitor-volume-buttons
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);
Full Reference
- GitHub: https://github.com/Cap-go/capacitor-volume-buttons/
- Docs: /docs/plugins/volume-buttons/
capgo을 계속 사용하세요. @capgo/capacitor-volume-buttons
__CAPGO_KEEP_0__을 사용하고 있다면 @capgo/capacitor-volume-buttons __CAPGO_KEEP_0__을 사용하여 native plugin 작업을 계획하고, @__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-volume-buttons와 연결하세요. @capgo/capacitor-volume-buttons의 implementation detail을 @capgo/capacitor-volume-buttons에서 확인하세요. for the implementation detail in @capgo/capacitor-volume-buttons, __CAPGO_KEEP_0__을 사용하여 native plugin 작업을 시작하세요. for the implementation detail in Getting Started, Capgo 플러그인 디렉토리 for the product workflow in Capgo 플러그인 디렉토리, Capacitor 플러그인들에 의해 Capgo for the implementation detail in Capacitor 플러그인들에 의해 Capgo, 그리고 __CAPGO_KEEP_0__ 플러그인 추가 또는 업데이트 for the implementation detail in __CAPGO_KEEP_0__ 플러그인 추가 또는 업데이트.