시작하기
이 플러그인에 대한 설치 단계와 전체 마크다운 가이드를 포함한 설정 프롬프트 복사하기
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-shake`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/shake/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
설치
설치 제목bun add @capgo/capacitor-shakebunx cap sync수입
수입 제목import { CapacitorShake } from '@capgo/capacitor-shake';API 개요
API 개요 제목addListener
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
__CAPGO_KEEP_0__ 네이티브 플러그인 버전을 가져옵니다.Capacitor 네이티브 플러그인 구현의 현재 버전을 반환합니다.
복사
import { CapacitorShake } from '@capgo/capacitor-shake';
const { version } = await CapacitorShake.getPluginVersion();console.log('Plugin version:', version);addListener 제목
실제 데이터의 원천이 페이지는 플러그인의 src/definitions.ts. upstream의 공공 API이 변경될 때 다시 동기화를 실행하세요.