Live updates Ionic dan Capacitor dengan @capgo/capacitor-updater
@capgo/capacitor-updater adalah plugin updater open-source di balik live updates Capgo untuk aplikasi Ionic dan Capacitor. Plugin ini mengunduh web bundle yang disetujui, menerapkannya dengan proteksi rollback native, dan menjaga perubahan binary tetap pada jalur review App Store dan Play yang normal.
Gunakan ini saat Anda butuh update OTA untuk HTML, CSS, JavaScript, assets, dan perubahan web-layer lainnya setelah native shell Anda disetujui.
Instal
npm install @capgo/capacitor-updater
npx cap sync
Cara Kerjanya
Bagi tim Ionic, live updates biasanya berarti workflow yang sama: kirim web bundle baru tanpa memaksa setiap user melewati full store release. Capgo menangani workflow tersebut untuk aplikasi Capacitor dengan fitur channels, pengecekan kompatibilitas, kontrol rollout, device logs, dan rollback.
Plugin native, entitlements, perubahan Android manifest, perubahan iOS plist, dan update binary SDK tetap memerlukan rilis app store normal. Kelola perubahan tersebut di pipeline Native Build Anda dan gunakan live updates untuk web layer yang sudah disetujui.
Yang Diekspos Plugin Ini
notifyAppReady- Beri tahu native layer bahwa JavaScript berhasil diinisialisasi.setUpdateUrl- Atur URL update aplikasi secara dinamis saat runtime.setStatsUrl- Atur URL statistik aplikasi secara dinamis saat runtime.setChannelUrl- Atur URL channel aplikasi secara dinamis saat runtime.
Contoh Penggunaan
notifyAppReady
Beri tahu native layer bahwa JavaScript berhasil diinisialisasi.
import { CapacitorUpdater } from '@capgo/capacitor-updater';
const result = await CapacitorUpdater.notifyAppReady();
console.log(result);
setUpdateUrl
Atur URL update aplikasi secara dinamis saat runtime.
import { CapacitorUpdater } from '@capgo/capacitor-updater';
await CapacitorUpdater.setUpdateUrl({ url: 'https://example.com' });
setStatsUrl
Atur URL statistik aplikasi secara dinamis saat runtime.
import { CapacitorUpdater } from '@capgo/capacitor-updater';
await CapacitorUpdater.setStatsUrl({ url: 'https://example.com' });
setChannelUrl
Atur URL channel aplikasi secara dinamis saat runtime.
import { CapacitorUpdater } from '@capgo/capacitor-updater';
await CapacitorUpdater.setChannelUrl({ url: 'https://example.com' });
Referensi Lengkap
- GitHub: https://github.com/Cap-go/capacitor-updater/
- Dokumentasi: /docs/plugins/updater/
- Produk Live update: /live-update/
Lanjutkan bersama @capgo/capacitor-updater
Jika Anda menggunakan @capgo/capacitor-updater untuk merencanakan live updates, hubungkan dengan Live Updates untuk alur kerja produk, @capgo/capacitor-updater untuk detail implementasi, Panduan Memulai, Channel, dan Rollback.