가이드
Cordova에서 Cordova Updater 사용법
@capgo/cordova-updater 사용하기
@capgo/cordova-updater Capgo 라이브 업데이트를 Cordova iOS 및 Android 앱에 제공합니다. 사용 방식은 다음과 동일합니다: API @capgo/capacitor-updater. Cordova 플러그인을 설치하고 notifyAppReady() 매 실행 시, 번들을 업로드하려면 @capgo/cli.
설치
cordova plugin add @capgo/cordova-updater --variable APP_ID=com.example.app
cordova prepare android ios
기본 사용법
document.addEventListener('deviceready', async () => {
const { Updater } = cordova.plugins;
await Updater.notifyAppReady();
const { bundle } = await Updater.current();
console.log('Active bundle', bundle);
const latest = await Updater.getLatest();
if (latest.url && !latest.error) {
const downloaded = await Updater.download({
url: latest.url,
version: latest.version,
checksum: latest.checksum,
});
await Updater.next({ id: downloaded.id });
}
});
플랫폼 요구 사항
- Cordova Android 13+ 및 Cordova iOS 7+
- 기본 Cordova WebView 스킴 (
https://localhost/Android에서,app://localhost/iOS에서) - 피하세요
cordova-plugin-ionic-webview— 번들 교체를 방지합니다
새 번들 배포하기
bun run build
bunx @capgo/cli@latest bundle upload --channel=production
실무 팁
- Capacitor 또는 Electron 클라이언트도 배포한다면 동일한 Capgo 앱 ID와 채널을 재사용하세요.
- 네이티브 플러그인이나 Cordova 플랫폼 업그레이드도 다른 네이티브 변경과 똑같이 취급하세요. JavaScript 번들에서 새 네이티브 API에 의존하기 전에 스토어용 새 바이너리를 배포하세요.
- 전체 설정 방법은 다음 문서에서 확인하세요: Cordova updater 문서.