Cordova Updater 시작하기
이 플러그인의 설치 단계와 전체 마크다운 가이드가 포함된 설정 프롬프트를 복사하세요.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/cordova-updater`
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/cordova-updater/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.
이 가이드는 @capgo/cordova-updater 을 Cordova 앱에 추가하여 iOS와 Android에서 Capgo 라이브 업데이트를 받는 방법을 안내합니다.
사전 요구사항
“사전 준비 사항” 섹션- Cordova CLI 12+
- Cordova Android 13+ 및/또는 Cordova iOS 7+
- Capgo 계정 (capgo.app/register)
설치
“설치” 섹션-
npm에서 플러그인을 설치하고 Capgo app ID를 전달하세요:
터미널 창 cordova plugin add @capgo/cordova-updater --variable APP_ID=YOUR_CAPGO_APP_ID -
선택 사항: 설치 시 기본값 재정의 (Capacitor updater와 동일한 변수):
터미널 창 cordova plugin add @capgo/cordova-updater \--variable APP_ID=YOUR_CAPGO_APP_ID \--variable DEFAULT_CHANNEL=production \--variable UPDATE_URL=https://plugin.capgo.app/updates \--variable AUTO_UPDATE=atBackground -
플러그인 변수 변경 후 네이티브 프로젝트를 준비하세요:
터미널 창 cordova prepare android ios
빠른 시작
“빠른 시작” 섹션document.addEventListener('deviceready', async () => { await cordova.plugins.Updater.notifyAppReady();});자주 하는 실수
“흔한 실수” 섹션- 이 플러그인과 cordova-plugin-ionic-webview를 함께 사용하지 마세요.
- 호출하세요
notifyAppReady()bundle이 로드되는 즉시—무거운 UI 작업이 롤백 윈도우를 지연시키기 전에. - Cordova 스키마 설정을 올바르게 유지하세요.
JavaScript 사용법
“JavaScript 사용” 섹션로컬에서 deviceready, 플러그인은 다음과 같이 사용할 수 있습니다 cordova.plugins.Updater:
document.addEventListener('deviceready', async () => { const { Updater } = cordova.plugins;
await Updater.notifyAppReady();
const latest = await Updater.getLatest(); if (latest.url && !latest.error) { const bundle = await Updater.download({ url: latest.url, version: latest.version, checksum: latest.checksum, });
await Updater.next({ id: bundle.id }); }});TypeScript 타입은 npm 패키지에 포함되어 있습니다:
import type { UpdaterPlugin } from '@capgo/cordova-updater';
declare const cordova: { plugins: { Updater: UpdaterPlugin } };플랫폼 참고 사항
“Platform notes” 섹션- WebView가 기본적으로 제공되도록 Cordova Android 13+가 필요합니다
https://localhost/필요합니다. - 이 플러그인은
CordovaPluginPathHandler다운로드한 bundle 에셋을 서빙하기 위해.
- 기본 scheme이 적용된 Cordova iOS 7 이상 버전이
app://localhost/필요합니다. - 이 플러그인은 bundle 요청을 가로채기 위해
CDVPluginSchemeHandler구현되었습니다.
첫 번째 번들을 업로드하세요
“첫 번째 bundle 업로드하기” 섹션웹 에셋을 빌드한 후, Capgo CLI를 사용하여 업로드하세요 (Capacitor와 동일한 워크플로우):
bun run buildnpx @capgo/cli@latest bundle upload --channel=production다음 단계
“다음 단계” 섹션- 설정 비교 대상: Capacitor updater 설정 — 대부분의 옵션이
plugin.xml변수로 매핑됩니다. - 읽기 Live update 호환성 네이티브 플러그인 변경 사항을 배포하기 전에.
- 나중에 Capacitor로 마이그레이션할 계획이라면? 동일한 Capgo 앱 ID와 채널을 유지하세요. 클라이언트 플러그인 패키지만 변경됩니다.