안내
Cordova 업데이터에 대한 튜토리얼
Cordova 업데이터를 사용하여 @capgo/cordova-updater
@capgo/cordova-updater brings Capgo live updates to Cordova iOS and Android apps with the same JavaScript API as @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 13+ 및 iOS Cordova 7+
- 기본 Cordova WebView 스키마 (
https://localhost/안드로이드에서app://localhost/iOS에서) - 피해야 할 것
cordova-plugin-ionic-webview— 그것은 번들 교환을 방지합니다
새 번들을 배포
bun run build
bunx @capgo/cli@latest bundle upload --channel=production
실용적인 조언
- 같은 Capgo 앱 ID와 채널을 재사용하고 Capacitor 또는 Electron 클라이언트도 배포한다면
- 자연 플러그인 또는 Cordova 플랫폼 업그레이드를 다른 네이티브 변경과 같이 다루세요: 새로운 네이티브 API를 자바스크립트 번들을 의존하는 새로운 스토어 바이너리를 배포하세요.
- 전체 설정 세부 사항은 CORDOVA 업데이터 문서.