Mise à jour manuelle
Configuración
Añade esto a tu capacitorconfigjson
, para deshabilitar la actualización automática
// capacitorconfigjson{ "appId": "*******", "appName": "Name", "plugins": { "CapacitorUpdater": { "autoUpdate": false, } }}
Uso
Puedes usar este ejemplo o recrear la lógica en tu aplicación
import { CapacitorUpdater } from '@capgo/capacitor-updater'import { SplashScreen } from '@capacitor/splash-screen'import { App } from '@capacitor/app'let data = {version: ""}CapacitorUpdaternotifyAppReady()AppaddListener('appStateChange', async(state) => { if (stateisActive) { // Do the download during user active app time to prevent failed download data = await CapacitorUpdaterdownload({ version: '004', url: 'https://github.com/Cap-go/demo-app/releases/download/004/distzip', }) } if (!stateisActive && dataversion !== "") { // Do the switch when user leave app SplashScreenshow() try { await CapacitorUpdaterset(data) } catch (err) { consolelog(err) SplashScreenhide() // in case the set fail, otherwise the new app will have to hide it } } })