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.
インストール
セクション:インストールCapgoのAIアシストセットアップを使用してプラグインをインストールできます。次のコマンドを使用して、AIツールにCapgoスキルを追加します。
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.Manual Setupを使用する場合は、以下のコマンドを実行してプラグインをインストールし、以下のプラットフォーム固有の指示に従ってください。
bun add @capgo/capacitor-shakebunx cap syncインポート
セクション:インポートimport { CapacitorShake } from '@capgo/capacitor-shake';API オーバービュー
セクション「API オーバービュー」addListener
セクション「addListener」デバイス上の振動イベントをリスンする
デバイスの加速度計を使用して振動パターンを検出する shake detection を使用して、デバイスの振動イベントを検出します。
import { CapacitorShake } from '@capgo/capacitor-shake';
const listener = await CapacitorShake.addListener('shake', () => { console.log('Shake detected!');});
// To remove the listener:await listener.remove();getPluginVersion
セクション「getPluginVersion」Capacitor プラグインのネイティブバージョンを取得する
__CAPGO_KEEP_0__ プラグインの実装の現在のバージョンを返します。
import { CapacitorShake } from '@capgo/capacitor-shake';
const { version } = await CapacitorShake.getPluginVersion();console.log('Plugin version:', version);真実の源
真実の源このページはプラグインから生成されています。 src/definitions.ts. upstream の API が変更されたときに、再度 Sync を実行してください。
Getting Started から続けてください。
Getting Started から続けてください。あなたが「 Getting Started ダッシュボードと API の作業を計画する場合、 Using @capgo/capacitor-shake Using @capgo/capacitor-shake API の概要 API の実装詳細 Introduction Introductionの実装詳細について API Keys API Keysの実装詳細について、 Devices Devicesの実装詳細について。