Zum Inhalt springen

Manuelle Aktualisierung

GitHub

Fügen Sie dies Ihrem capacitor.config.json, um die automatische Aktualisierung zu deaktivieren.

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

Sie können dieses Beispiel verwenden oder die Logik in Ihrem App neu erstellen.

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
}
}
})

Wenn Sie Manueller Aktualisierung verwenden Manueller Aktualisierung um die Migration und die Betriebsabläufe für Unternehmen zu planen, verbinden Sie ihn mit Verwendung von @capgo/capacitor-aktualisierer zur nativen Fähigkeit in Verwendung von @capgo/capacitor-aktualisierer Capgo Unternehmen for the product workflow in Capgo Enterprise, zur Produktablauf in __CAPGO_KEEP_0__ Unternehmen Ionische Unternehmen-Plugin-Alternativen Capgo Alternatives für das Produktworkflow in Capgo Alternativen und Capgo Consulting für das Produktworkflow in Capgo Consulting.