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.
-
패키지를 설치하세요.
터미널 창 npm i @capgo/capacitor-auto -
Sync native projects
터미널 창 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 },});플랫폼 설정
플랫폼 설정 섹션- Follow the iOS 설정 페이지에서 CarPlay scene 및 권한 노트를 참조하십시오.
- Follow the Android 설정 페이지에서 Android Auto 카테고리 및 매니페스트 노트를 참조하십시오.
Getting Started에서 계속하기
Getting Started에서 계속하기Capgo를 사용하여 Getting Started native 플러그인 작업을 계획하고 있습니다. Capgo를 사용하여 Using @capgo/capacitor-auto 자연스러운 기능을 위해 @capgo/capacitor-auto를 사용하세요. Capgo 플러그인 디렉토리 Capgo 플러그인에 대한 __CAPGO_KEEP_1__의 제품 워크플로우 Capacitor 플러그인에 의해 Capgo Capacitor 플러그인에 의해 Capgo의 구현 세부 사항 플러그인을 추가하거나 업데이트 __CAPGO_KEEP_0__ 플러그인에 의해 __CAPGO_KEEP_1__의 구현 세부 사항 아이오닉 엔터프라이즈 플러그인 대안 아이오닉 엔터프라이즈 플러그인 대안의 제품 워크플로우