시작하기
이 플러그인의 설치 단계와 전체 마크다운 가이드를 포함한 설치 명령어를 복사합니다.
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);});
빈 상태
빈 상태설정 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 장면과 권한 노트에 대한 페이지를 참조하십시오. Android 설정
- CarPlay 장면과 권한 노트에 대한 페이지를 참조하십시오. Follow the Android Auto 카테고리와 매니페스트 노트의 페이지입니다.
시작하기에서 계속
시작하기에서 계속만약에 사용 중이라면 시작하기 Capgo를 사용하여 네이티브 플러그인 작업을 계획하고 있습니다. Capgo를 사용하여 네이티브 플러그인 작업을 계획하고 있습니다. Using @capgo/capacitor-auto for the native capability in Using @capgo/capacitor-auto, Capgo Plugin Directory for the product workflow in Capgo Plugin Directory, Capacitor Plugins by Capgo for the implementation detail in Capacitor Plugins by Capgo, 플러그인 추가 또는 업데이트 Adding or Updating Plugins 플러그인 추가 또는 업데이트 구현 세부 사항 for the implementation detail in Adding or Updating Plugins, and