Démarrage
Copiez un prompt de configuration avec les étapes d'installation et le guide markdown complet pour ce plugin.
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.
Installer
Section intitulée « Installer »bun add @capgo/capacitor-shakebunx cap syncImporter
Section intitulée « Importer »import { CapacitorShake } from '@capgo/capacitor-shake';API Vue d'ensemble
Section intitulée « API Vue d'ensemble »addListener
Section intitulée « addListener »Écoutez l'événement de secousses sur le dispositif.
Enregistre un écouteur qui sera appelé chaque fois qu'un geste de secousses est détecté.
import { CapacitorShake } from '@capgo/capacitor-shake';
const listener = await CapacitorShake.addListener('shake', () => { console.log('Shake detected!');});
// To remove the listener:await listener.remove();getPluginVersion
Copier dans le presse-papierGet the native Capacitor plugin version.
Obtenez la version native du plugin __CAPGO_KEEP_0__.
import { CapacitorShake } from '@capgo/capacitor-shake';
const { version } = await CapacitorShake.getPluginVersion();console.log('Plugin version:', version);Copier dans le presse-papier
Source De VéritéSection intitulée « Source De Vérité » src/definitions.tsCette page est générée à partir des informations du plugin. Re-run la synchronisation lorsque les modifications publiques API sont détectées en amont.