Getting Started
インストール手順とこのプラグインの完全なマークダウンガイドを含むセットアップコマンドをコピーしてください。
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.
インストール
「インストール」のセクションYou can use our AI-Assisted Setup to install the plugin. Add the Capgo skills to your AI tool using the following command:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-pluginsコピー
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-shake` plugin in my project.コピー
bun add @capgo/capacitor-shakebunx cap syncコピー
インポートimport { CapacitorShake } from '@capgo/capacitor-shake';コピーをします。APIの概要
Section titled “API Overview”addListener
Section titled “addListener”Listen for shake event on the device.
addListenerを使用して、shakeイベントが検出されたときに呼び出されるリスナーを登録します。
import { CapacitorShake } from '@capgo/capacitor-shake';
const listener = await CapacitorShake.addListener('shake', () => { console.log('Shake detected!');});
// To remove the listener:await listener.remove();getPluginVersion
Copy to clipboardGet the native Capacitor plugin version.
Get the native __CAPGO_KEEP_0__ plugin version.
import { CapacitorShake } from '@capgo/capacitor-shake';
const { version } = await CapacitorShake.getPluginVersion();console.log('Plugin version:', version);Copy to clipboard
Source Of TruthSection titled “Source Of Truth” src/definitions.ts. upstream の API が変更されたときに、再度 sync を実行してください。
Getting Started から続けてください。
Getting Started から続けてください。「Getting Started から続けてください。」というセクション あなたが「Getting Started から続けてください。」を使用している場合 あなたがダッシュボードと API の作業を計画するために使用している場合、API を接続してください。 Using @capgo/capacitor-shake Using @capgo/capacitor-shake のネイティブ機能 API Overview API の実装詳細 Introduction Introduction の実装詳細 API キー API キーとその実装詳細のための デバイス デバイスの実装詳細のための