Installation
Copiez un prompt de configuration avec les étapes d'installation et la 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 « Import »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);Source Of Truth
Section intitulée « Source Of Truth »Cette page est générée à partir du plugin’s src/definitions.tsRe-run the sync when the public API changes upstream.
Continuez de Getting Started
Section intitulée « Continuez de Getting Started »Si vous utilisez Getting Started pour planifier le tableau de bord et les opérations API, connectez-le avec Utilisez @capgo/capacitor-shake pour la capacité native dans Utilisez @capgo/capacitor-shake, Vue d'ensemble de API pour les détails d'implémentation dans API Vue d'ensemble, Introduction pour les détails d'implémentation dans Introduction, API Clés pour les détails d'implémentation dans API Clés, et Appareils pour les détails d'implémentation dans Appareils.