Getting Started¶
In order to use Capawesome Cloud Live Updates, you must first install and configure the Capacitor Live Update plugin.
Preparation¶
Create an account on the Capawesome Cloud Console to get started.
Installation¶
Within your Capacitor app project, install the plugin and sync your Capacitor project:
Configuration¶
You can configure the plugin via the Capacitor configuration file. See Configuration for more information.
App ID¶
In order for your app to identify itself to Capawesome Cloud, you must configure an app ID:
{
"plugins": {
"LiveUpdate": {
"appId": "00000000-0000-0000-0000-000000000000"
}
}
}
For this, you need to create an app on the Capawesome Cloud Console.
The app ID can then be copied via the item menu:
Sync your Capacitor project to apply the changes:
That's it! You are now ready to use the Capawesome Cloud Live Updates plugin.
Usage¶
The following two methods are essential for using the plugin:
ready()
: Notify the plugin that the app is ready to use and no rollback is needed.sync()
: Automatically download and set the latest bundle for the app.
The reload()
method is optional and is only needed if you want to apply the new bundle immediately.
import { LiveUpdate } from '@capawesome/capacitor-live-update';
const ready = async () => {
await LiveUpdate.ready();
};
const sync = async () => {
const result = await LiveUpdate.sync();
if (result.nextBundleId) {
await LiveUpdate.reload();
}
};
Check out the API reference to see what else you can do with this plugin.