Introduction - Auto Update
Questi contenuti non sono ancora disponibili nella tua lingua.
This documentation will explain how to run your auto-update server.
Before start
If you use this work on your own, I couldn’t suggest more to support my work through this.
I made a big bet to open source all the precious code I built here.
I could have kept it for myself and put a high ticket price.
Furthermore, I want to focus on Capgo tooling and make it an open and transparent business.
Likewise, I do think it would make our world a better place by opening instead of fighting and hiding.
But to make it possible, all of us must do our part, including you 🥹.
If capgo offers can’t suit you, then put your price and back a bootstrapped Maker HERE on your terms.
Quick installs
Configuration
You have to configure the plugin to use your URL like that:
🚧 In android it’s not allowed to request to HTTP, for testing purposes allow it
Update API
The plugin will do a POST call to your API each time the app is open, with this body:
The server API should respond, in JSON, to the capacitor-updater plugin. With this data if an update is necessary:
In Auto-update the server should do the work of comparing the version and return the right one, if the URL key is present, the plugin starts the download process.
If you add “message” and “error” key, the version will not be set, and the message will be displayed in logs instead.
version
key should be in semver
format.
The zip should have index.html
as a file at the root, or only one folder at the root with index.html
inside.
You can use the command of the CLI to zip your bundle:
End-to-end Encryption
Starting with version 4.15.0 the plugin allows you to send encrypted updates.
You can use this feature by creating a private key npx @capgo/cli key create
Then you encrypt your zip file with npx @capgo/cli encrypt [path/to/zip]
The command will print you a ivSessionKey
it has to be sent with your update payload in the key session_key
.
Then your app will be able to use the private key to decrypt the session_key
and use the decrypted session_key
to decrypt the update.
Learn more about it here:
Statistics API
Starting from version 1.3.0 the update system sends stats!
By default, all stats are sent to our server, to understand usage.
💡 No private data is sent for stats, only random UUID, version update, version native app, platform, action, and app ID.
If you want to send data to your server instead, change the config below:
What your server will receive is :
You can also totally disable it, with an empty string. Keep in mind, statistics are made private friendly and help me to understand how people use the plugin, to resolve issues and improve it.
Channel API
To be documented