Cordova Updater 시작하기
이 플러그인의 설치 단계와 전체 markdown 가이드가 포함된 설정 프롬프트를 복사하세요.
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 iOS 및 Android에서 Capgo live updates를 받을 수 있도록 Cordova 앱에 설정하는 방법입니다.
사전 요구사항
사전 요구 사항- Cordova CLI 12 이상
- Cordova Android 13 이상 및/또는 Cordova iOS 7 이상
- Capgo 계정으로 (capgo.app/register)
-
npm에서 플러그인을 설치하고 Capgo 앱 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 -
플러그인 변수 변경 후 Native Build 준비:
터미널 창 cordova prepare android ios
빠른 시작
“Quick start” 섹션document.addEventListener('deviceready', async () => { await cordova.plugins.Updater.notifyAppReady();});자주 하는 실수
“자주 하는 실수” 섹션- 이 플러그인과 cordova-plugin-ionic-webview를 함께 사용하지 마세요.
- 호출
notifyAppReady()번들이 로드되는 즉시 호출하세요. 무거운 UI 작업으로 인해 롤백 가능 시간이 지연되기 전이어야 합니다. - Cordova scheme 설정을 올바르게 유지하세요.
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 }); }});npm 패키지에 TypeScript 타입이 포함되어 있습니다:
import type { UpdaterPlugin } from '@capgo/cordova-updater';
declare const cordova: { plugins: { Updater: UpdaterPlugin } };플랫폼 참고 사항
“플랫폼 참고 사항” 섹션- WebView가 기본 scheme에서 제공되려면 Cordova Android 13 이상이 필요합니다.
https://localhost/scheme. - 플러그인이 다음을 등록합니다:
CordovaPluginPathHandler다운로드한 bundle 에셋을 서빙하기 위해.
- 기본 scheme이 적용된 Cordova iOS 7 이상 버전이
app://localhost/필요합니다. - 이 플러그인은 bundle 요청을
CDVPluginSchemeHandler가로채기 위해 구현되었습니다.
첫 번째 bundle 업로드하기
“첫 번째 bundle 업로드하기” 섹션웹 에셋을 빌드한 후, Capgo CLI를 사용하여 업로드하세요 (Capacitor와 동일한 워크플로우):
bun run buildnpx @capgo/cli@latest bundle upload --channel=production다음 단계
“다음 단계” 섹션- 다음 설정과 비교해 보세요: Capacitor updater 설정 — 대부분의 옵션은
plugin.xml변수와 매핑됩니다. - 읽어보세요 Live update 호환성 Native Build 플러그인 변경 사항을 배포하기 전에.
- 나중에 Capacitor로 마이그레이션하시나요? Capgo 앱 ID와 채널은 그대로 유지하면 됩니다. 클라이언트 플러그인 패키지만 변경됩니다.