다음 단계
설치
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.
이 안내서에서는 Cordova 앱에 @capgo/cordova-updater to a Cordova app so you can receive Capgo live updates on iOS and Android.
Cordova __CAPGO_KEEP_0__ 12+
__CAPGO_KEEP_0__- CLI
- 안드로이드 13 이상 및/또는 iOS 7 이상 Cordova
- 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 -
Optional: override defaults at install time (same variables as the 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
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 } };플랫폼 참고사항
플랫폼 참고사항- Cordova Android 13 이상이 필요하여 WebView는 기본으로 제공됩니다.
https://localhost/scheme. - 다운로드 된 패키지 자산을 제공하기 위해 플러그인을 등록합니다.
CordovaPluginPathHandlerCordova iOS 7 이상이 필요하여 기본
- scheme.
app://localhost/패키지 요청을 가로채기 위해 플러그인이 implement합니다. - 첫 번째 패키지를 업로드하세요
CDVPluginSchemeHandler제목: 첫 번째 패키지를 업로드하세요
웹 자산을 빌드한 후 __CAPGO_KEEP_0__ __CAPGO_KEEP_1__ (__CAPGO_KEEP_2__와 동일한 워크플로우)로 업로드하세요.
Build your web assets, then upload with the __CAPGO_KEEP_0__ __CAPGO_KEEP_1__ (same workflow as __CAPGO_KEEP_2__):Build your web assets, then upload with the Capgo CLI (same workflow as Capacitor):
bun run buildbunx @capgo/cli@latest bundle upload --channel=production다음 단계
다음 단계- __CAPGO_KEEP_0__ 업데이트 설정과 Capacitor 대부분의 옵션은 변수로 매핑됩니다.
plugin.xml읽기 - 라이브 업데이트 호환성 네이티브 플러그인 변경을 배송하기 전에 읽어보세요. Capgo로 이전하는 경우?
- Migrating to Capacitor later? Keep the same Capgo app ID and channels; only the client plugin package changes.