주요 콘텐츠로 건너뛰기
플러그인으로 돌아가기
@capgo/capacitor-shake
튜토리얼
github.com/Cap-go에서 제공하는

shake

장치에서 shake 동작 감지하여 undo 또는 feedback와 같은 액션을 트리거하는

가이드

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

전체 참조