Aller directement au contenu

Actualisation manuelle

GitHub

Ajoutez ceci à votre capacitor.config.json, pour désactiver la mise à jour automatique.

// capacitor.config.json
{
"appId": "**.***.**",
"appName": "Name",
"plugins": {
"CapacitorUpdater": {
"autoUpdate": "off",
}
}
}

Vous pouvez utiliser cet exemple ou recréer la logique dans votre application.

import { CapacitorUpdater } from '@capgo/capacitor-updater'
import { SplashScreen } from '@capacitor/splash-screen'
import { App } from '@capacitor/app'
let data = {version: ""}
CapacitorUpdater.notifyAppReady()
App.addListener('appStateChange', async(state) => {
if (state.isActive) {
// Do the download during user active app time to prevent failed download
data = await CapacitorUpdater.download({
version: '0.0.4',
url: 'https://github.com/Cap-go/demo-app/releases/download/0.0.4/dist.zip',
})
}
if (!state.isActive && data.version !== "") {
// Do the switch when user leave app
SplashScreen.show()
try {
await CapacitorUpdater.set(data)
} catch (err) {
console.log(err)
SplashScreen.hide() // in case the set fail, otherwise the new app will have to hide it
}
}
})

If vous utilisez Update manuel pour planifier la migration et les opérations d'entreprise, connectez-le à En utilisant @capgo/capacitor-mises-à-jour native pour la capacité native dans En utilisant @capgo/capacitor-mises-à-jours native, Capgo Entreprise pour le flux de travail du produit dans Capgo Entreprise, Alternatives d'extension d'entreprise d'Ionic pour le flux de travail du produit dans Alternatives d'extension d'entreprise d'Ionic, Capgo Alternatives pour le flux de travail du produit dans Capgo Alternatives, et Consulting de Capgo pour le flux de travail du produit dans Capgo Consulting.