가이드
Shake 튜토리얼
Using @capgo/capacitor-shake
Capacitor Shake Plugin interface for detecting shake gestures on mobile devices. This plugin allows you to listen for shake events and get plugin version information.
이 플러그인이 제공하는 것
bun add @capgo/capacitor-shake
bunx cap sync
- 장치에서 흔들기 이벤트를 감지합니다.
addListener- __CAPGO_KEEP_0__ 플러그인 버전을 가져옵니다.getPluginVersion- Get the native Capacitor plugin version.
Install
addListener
장치에서 흔들기 이벤트를 듣습니다.
import { CapacitorShake } from '@capgo/capacitor-shake';
const listener = await CapacitorShake.addListener('shake', () => {
console.log('Shake detected!');
});
// To remove the listener:
await listener.remove();
getPluginVersion
Capacitor 네이티브 플러그인 버전을 가져옵니다.
import { CapacitorShake } from '@capgo/capacitor-shake';
const { version } = await CapacitorShake.getPluginVersion();
console.log('Plugin version:', version);
전체 참조
- GitHub: https://github.com/Cap-go/capacitor-shake/
- 문서: /docs/plugins/shake/