From V3 to V4
Why this upgrade
After many talk in the discord community with you. I discovered the manual mode was very too manual and not safe to use, for example, auto-revert was not possible, so if you failed update in manual the user have to remove the app and install back, what is terrible UX.
Meanwhile, I took this as an opportunity to give more freedom to you, and remove all bad code I made.
npm i @capgo/capacitor-updater@4
If you use the basic example in your app, you are safe to migrate to the new version, enjoy!
For you, still simple, the changes are:
- The name of the setting from
- The Endpoint method changed from
For you, this is the most significant change, but for the best! You get tons of improvements, Read carefully.
updateUrlsince this setting can be used in manual mode now too
- Delete of
delayUpdatein favor of
- No more
versionkey, who was returned in most function to object
- Renamed of misleading names now (even to explain cannot be clear, but at usage is easy to understand the new one):
- what was called a
versionis now referring to a
idrefer to the old
versionwho was a random string of 10 char, this
idis the only trustable and unique way to access to your bundles, example
versionrefer now to the
versionNameyou choose for a bundle, example
- what was called a
post, since custom headers were a problem for some of you and post is more logical, all previous headers go to the body and prefix
versionNamemethod is deleted, in favor of
- list returns now a list of
autoUpdatebecomes true by default, if you use Manual mode, set it to false.
getLatest, this method allows you to get from your server set with
updateUrlthe last version available.
:“background” | “kill” | “nativeVersion” | “date”, value? : string
}as argument to set delay to different modes.
next, to set the version in next backgrounding, in opposite to
setwho do it instantly.
isAutoUpdateEnabled, to let you know if you are in auto-update context
downloadCompletewhen download reach 100%
- Added mandatory field
versionin download method
notifyAppReadybecome mandatory in manual mode too, if not call after 10 sec the app reverts to past version.
@lincolnthree Thank you so much for starting this work, it was impossible to make this update work without you.