Cordova 업데이터와 함께 시작하기
설치 단계와 이 플러그인의 전체 마크다운 가이드를 포함한 설정 프롬프트를 복사하세요.
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.
이 가이드는 iOS 및 Android에서 __CAPGO_KEEP_0__ 라이브 업데이트를 받기 위해 Cordova 앱에 추가하는 방법을 안내합니다. @capgo/cordova-updater to a Cordova app so you can receive Capgo live updates on iOS and Android.
필요 조건
필요 조건- Cordova CLI 12+
- Cordova Android 13 이상과/또는 Cordova iOS 7 이상
- A Capgo account (capgo.app/register)
설치
설치-
Install the plugin from npm and pass your Capgo app ID:
터미널 창 cordova plugin add @capgo/cordova-updater --variable APP_ID=YOUR_CAPGO_APP_ID -
설치 시 기본값을 오버라이드할 수 있습니다 (업데이터 Capacitor와 동일한 변수):
터미널 창 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
자바스크립트 사용
자바스크립트 사용변경 후 플러그인은 deviceready__CAPGO_KEEP_0__와 동일한 변수로 사용할 수 있습니다. 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 } };플랫폼 참고 사항
플랫폼 참고 사항- Cordova Android 13 이상이 필요하여 WebView는 기본
https://localhost/scheme에서 제공됩니다. - 이 플러그인은 다운로드 된 패키지 자산을
CordovaPluginPathHandler을 제공하기 위해
- Cordova iOS 7 이상이 필요합니다. 기본
app://localhost/scheme. - 이 플러그인은
CDVPluginSchemeHandlerbundle 요청을 가로채기 위해 구현합니다.
첫 번째 배치를 업로드하세요
제목: 첫 번째 배치를 업로드하세요웹 자산을 빌드한 후 Capgo CLI (Capacitor와 동일한 워크플로우)와 함께 업로드하세요:
bun run buildbunx @capgo/cli@latest bundle upload --channel=production다음 단계
제목: 다음 단계- 업데이터 __CAPGO_KEEP_0__ 설정과 비교하세요 업데이터 Capacitor 설정과 비교하세요 — 대부분의 옵션은 변수에 mapping됩니다.
plugin.xml변수. - 읽기 실시간 업데이트 호환성 native 플러그인 변경 사항을 배송하기 전에.
- Capacitor로 마이그레이션하는지 궁금하다? Capgo 앱 ID와 채널은 동일하게 유지하고 클라이언트 플러그인 패키지만 변경한다.