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.
インストール
Section titled “インストール”AI-Assisted セットアップを使用してプラグインをインストールできます。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 セットアップを使用する場合は、以下のコマンドを実行してプラグインをインストールし、以下のプラットフォーム固有の指示に従ってください。
-
パッケージをインストール
ターミナル画面 npm i @capgo/capacitor-auto -
ネイティブ プロジェクトを同期
ターミナル画面 npx cap sync -
root車テンプレートを設定
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);});
空の状態
「空の状態」のセクションセット emptyText テンプレートが行を持たない場合に設定します:
await Auto.setRootTemplate({ title: 'Garage', emptyText: 'No actions are available right now.', sections: [],});橋渡しメッセージを送信
橋渡しメッセージを送信するセクション使用 sendMessage アプリケーション定義のネイティブ橋渡しメッセージ用:
await Auto.sendMessage({ type: 'status', payload: { online: true },});プラットフォーム設定
プラットフォーム設定のセクション- 設定を iOS設定 CarPlayシーンと特権に関するメモのページ。
- Follow the Androidのセットアップ Android Autoカテゴリとマニフェストに関するメモのページ。
Getting Startedから続けてください。
Getting Startedから続けてください。Capacitorを使用している場合、 Capacitorを使用している場合、 Capacitorを使用している場合、@__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-autoを使用して Capacitorを使用している場合、@capgo/capacitor-autoを使用して Capacitorを使用している場合、@capgo/capacitor-autoを使用して Capgo プラグイン ディレクトリ 製品ワークフローについての説明は、Capgo プラグインディレクトリで行います。 Capacitor プラグインは、Capgo によって提供されます。 実装の詳細については、Capacitor プラグインは、Capgo によって提供されます。 プラグインの追加または更新 製品ワークフローについての説明は、プラグインの追加または更新で行います。 Ionic Enterprise プラグインの代替 製品ワークフローについての説明は、Ionic Enterprise プラグインの代替で行います。