-
-
Notifications
You must be signed in to change notification settings - Fork 134
Upgrade from v3 to v4 alpha
After many talk in the discord community with you. I discover the manual mode was very too manual and not safe to use, as 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@next
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 setting autoUpdateUrl and the change from get to post
For you, this is the most significant changes, but for the best! You get tons of improvements, Read carefully.
-
autoUpdateUrlbecomeupdateUrlsince this setting can be use in manual mode now too - Delete of
cancelDelayanddelayUpdatein favor ofsetDelay - No more
versionNamein set - Change
versionkey who was returned in most function to objectBundleInfo
interface BundleInfo {
id: string;
version: string;
downloaded: string;
status: 'success' | 'error' | 'pending' | 'downloading'
}- 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 refer to abundle -
idrefer to the oldversionwho was a random string of 10 char, thisidis the only trustable and unique way to access to your bundles, example7Dfcd2RedN. -
versionrefer now to theversionNameyou choose for a bundle, example1.0.0
- what was called a
-
updateUrlmove fromgettopost, since custom headers were a problem to some of you and post is more logical, all previous headers go to the body and prefixcap_disappear. -
versionNamemethod is deleted, in favor ofgetId - list return now a list of
BundleInfo - Rename
getIdingetDeviceId
- Method
getLatest, this method allow you to get from your server set withupdateUrlthe last version available. - Method
setDelaywho take{delay: boolean}as argument to set true or false the delay for auto-update - Method
next, to set the version in next backgrounding, in opposite tosetwho do it instantly. - Method
isAutoUpdateEnabled, to let you know if you are in auto-update context - Event
downloadCompletewhen download reach 100% - Added mandatory field
versionin download method -
notifyAppReadybecome mandatory in manual mode too, if not call after 10 sec the app revert to past version
@lincolnthree Thank you so much for starting this work, it was impossible to make this update work without you.