Auto update
It allows developers to use capacitor-updater with auto-update mode link to Capgo channel or equivalent.
The only, thing you need to do before using Capgo auto-update is using https://semver.org/ for your app versioning.
This is the convention it used to manage version. This convention should be use in 3 files in your project:
package.json
in versionandroid/app/build.gradle
in versionNameios/App/App.xcodeproj/project.pbxproj
in CURRENT_PROJECT_VERSION
Setup your app in 5 mins
Setup your CI in 5 mins
npm install @capgo/capacitor-updater
npx cap sync
The server allows you to manage channel and version and much more.
autoUpdate
will use data from `capacitor.config` to identify into the Capgo serverℹ️ You can use Capgo Cloud without sending your code to our server. If that not allowed by your company
When auto-update is setup you have to send signal from JS that your app is alive
This can be done by calling within your app
notifyAppReady
.Do it as soon as possible.
import { CapacitorUpdater } from '@capgo/capacitor-updater'
CapacitorUpdater.notifyAppReady()
- When User open app, it calls server to check for update, if found it download in background.
- When user leave the app, new version is set as active
- When user open again, he sees new app
- If
notifyAppReady()
is call, when user leave, past version is delete. - If not call, when user leave, version is reset to past one and marked as invalid.
- User Continue normal flow until next update process
When you develop, be sure to remove
autoUpdate
from your config or set it to false. Otherwise, you will not see your change after app grounding. If you forget to do so, remove it and remove the app before building. Otherwise, you will stay stuck on the downloaded code.To upload version at each commit setup CI/CD with this guide
When
disableAutoUpdateBreaking
is true, you can listen to event to know when app refuse to do major braking update.import { CapacitorUpdater } from '@capgo/capacitor-updater';
CapacitorUpdater.addListener('majorAvailable', (info: any) => {
console.log('majorAvailable was fired', info.version);
});
To have more control over auto-update system, I added 1 setting to allow you:
resetWhenUpdate
: When store update happen, disable force reset to native version
To configure the plugin, use these settings:
// capacitor.config.json
{
"appId": "**.***.**",
"appName": "Name",
"plugins": {
"CapacitorUpdater": {
"autoUpdate": true,
"resetWhenUpdate": false
}
}
}
Last modified 3mo ago