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-auto`
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/auto/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.
インストール
「インストール」のセクションAI-Assisted Setupを使用してプラグインをインストールできます。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-auto` plugin in my project.Manual Setupを使用する場合は、以下のコマンドを実行してプラグインをインストールし、以下のプラットフォーム固有の指示に従ってください。
-
パッケージのインストール
ターミナル画面 npm i @capgo/capacitor-auto -
ネイティブプロジェクトを同期
ターミナルウィンドウ npx cap sync -
ルートカータイプテンプレートを設定
import { Auto } from '@capgo/capacitor-auto';await Auto.setRootTemplate({title: 'Garage',sections: [{header: 'Doors',items: [{id: 'open-main-door',title: 'Open main door',subtitle: 'Tap to send the action to the phone app',payload: { doorId: 'main' },},],},],}); -
カーアクションを処理
await Auto.addListener('carAction', async (event) => {if (event.id === 'open-main-door') {await openGarageDoor(event.payload?.doorId);}}); -
接続状態を追跡
const status = await Auto.isAvailable();console.log(status.available, status.connected, status.platform);await Auto.addListener('connectionChanged', (event) => {console.log('Car connected:', event.connected, event.platform);});
__CAPGO_KEEP_0__
Section titled “__CAPGO_KEEP_0__”Set emptyText when the template has no rows:
await Auto.setRootTemplate({ title: 'Garage', emptyText: 'No actions are available right now.', sections: [],});Send __CAPGO_KEEP_2__ messages
Section titled “Send __CAPGO_KEEP_2__ messages”Use sendMessage for application-defined native __CAPGO_KEEP_3__ messages:
await Auto.sendMessage({ type: 'status', payload: { online: true },});Platform setup
プラットフォーム設定- を参照してください。 iOS設定 CarPlayシーンとエンタイトルメントに関する詳細を参照するためのページ
- を参照してください。 Android設定 Android Auto カテゴリとマニフェストに関する詳細を参照するためのページ
Getting Startedから続けてください。
Section titled “Getting Startedから続けてください”Capgoを使用している場合、 Getting Started を使用してネイティブ プラグインの作業を計画する場合、 Capacitor @capgo/capacitor-autoを使用 Capacitor @capgo/capacitor-autoのネイティブ機能を使用 Capgo プラグインディレクトリ Capgo プラグインの製品ワークフロー Capacitor プラグイン (@Capgo) Capacitor プラグイン (@Capgo)の実装詳細 プラグインの追加または更新 プラグインの追加または更新の実装詳細 Ionic Enterprise プラグインの代替 Ionic Enterprise プラグインの代替の製品ワークフロー