내용으로 건너뛰기

Getting Started

GitHub

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을 선호한다면, 다음 명령어를 실행하고 아래의 플랫폼별 지침을 따르세요:

  1. 패키지 설치

    터미널 창
    npm i @capgo/capacitor-auto
  2. 자연어 프로젝트 동기화

    터미널 창
    npx cap sync
  3. root car 템플릿 설정

    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' },
    },
    ],
    },
    ],
    });
  4. 자동차 액션 처리

    await Auto.addListener('carAction', async (event) => {
    if (event.id === 'open-main-door') {
    await openGarageDoor(event.payload?.doorId);
    }
    });
  5. __CAPGO_KEEP_1__

    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: [],
});

__CAPGO_KEEP_2__

Send bridge messages

Send bridge messages sendMessage Send bridge messages

await Auto.sendMessage({
type: 'status',
payload: { online: true },
});

Send bridge messages

Platform setup

Getting Started에서 계속 진행하세요

Getting Started에서 계속 진행하는 섹션

Capacitor를 사용 중이라면 Getting Started Capacitor를 사용하여 Native 플러그인 작업을 계획하고자 할 때, Capacitor를 사용하여 Native 기능을 연결하는 @capgo/capacitor-auto Capacitor를 사용하여 Native 기능을 연결하는 @capgo/capacitor-auto에서 Capgo 플러그인 디렉토리 Capacitor를 사용하여 제품 워크플로우를 연결하는 Capgo 플러그인 디렉토리에서 Capacitor Plugins by Capgo Capacitor를 사용하여 구현 세부 정보를 연결하는 Capacitor 플러그인에 의해 Capgo 플러그인을 추가하거나 업데이트 __CAPGO_KEEP_0__ 구현 세부 사항에 대한 정보를 추가하거나 플러그인을 업데이트하는 데 사용하는 방법에 대해 설명합니다. Ionic Enterprise 플러그인 대체 옵션 __CAPGO_KEEP_0__ 플러그인 업데이트에 대한 제품 워크플로에 대해 설명합니다.