Skip to content

Commit 1005aed

Browse files
committed
feat(docs): small tweaks to live-updates Capacitor page(s)
1 parent 63c7cd1 commit 1005aed

File tree

2 files changed

+50
-24
lines changed

2 files changed

+50
-24
lines changed

docs/src/pages/quasar-cli-vite/developing-capacitor-apps/live-updates.md

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,15 @@ cd src-capacitor
1515

1616
Then, install the plugin:
1717

18-
```bash
19-
npm install @capawesome/capacitor-live-update
18+
```tabs
19+
<<| bash Yarn |>>
20+
$ yarn add @capawesome/capacitor-live-update
21+
<<| bash NPM |>>
22+
$ npm install --save @capawesome/capacitor-live-update
23+
<<| bash PNPM |>>
24+
$ pnpm add @capawesome/capacitor-live-update
25+
<<| bash Bun |>>
26+
$ bun add @capawesome/capacitor-live-update
2027
```
2128

2229
After that, you need to sync the changes with your native projects:
@@ -31,9 +38,9 @@ Next, you need to configure the plugin to work with [Capawesome Cloud](https://c
3138

3239
### App ID
3340

34-
In order for your app to identify itself to Capawesome Cloud, you need to set the `appId` in your `capacitor.config.ts` file. For this, you need to create an app on the [Capawesome Cloud Console](https://console.cloud.capawesome.io/) and get the App ID.
41+
In order for your app to identify itself to Capawesome Cloud, you need to set the `appId` in your `capacitor.config` file. For this, you need to create an app on the [Capawesome Cloud Console](https://console.cloud.capawesome.io/) and get the App ID.
3542

36-
```json
43+
```json /src-capacitor/capacitor.config file
3744
{
3845
"plugins": {
3946
"LiveUpdate": {
@@ -55,15 +62,15 @@ npx cap sync
5562

5663
The most basic usage of the Live Update plugin is to call the [`sync(...)`](https://capawesome.io/plugins/live-update/#sync) method when the app starts. This method checks for updates, downloads them if available, and sets them as the next bundle to be applied. You can then call the [`reload()`](https://capawesome.io/plugins/live-update/#reload) method to apply the update immediately. If the [`reload()`](https://capawesome.io/plugins/live-update/#reload) method is not called, the new bundle will be used on the next app start.
5764

58-
```ts
59-
import { LiveUpdate } from "@capawesome/capacitor-live-update";
65+
```js
66+
import { LiveUpdate } from "@capawesome/capacitor-live-update"
6067

6168
const sync = async () => {
62-
const result = await LiveUpdate.sync();
69+
const result = await LiveUpdate.sync()
6370
if (result.nextBundleId) {
64-
await LiveUpdate.reload();
71+
await LiveUpdate.reload()
6572
}
66-
};
73+
}
6774
```
6875

6976
## Publishing updates
@@ -77,8 +84,15 @@ quasar build -m capacitor -T [android|ios]
7784
This will create a `src-capacitor/www` folder with the build output of your web app. You can then upload this folder to Capawesome Cloud using the [Capawesome CLI](https://capawesome.io/cloud/cli/).
7885
To install the Capawesome CLI, run the following command:
7986

80-
```bash
81-
npm install -g @capawesome/cli
87+
```tabs
88+
<<| bash Yarn |>>
89+
$ yarn global add @capawesome/cli
90+
<<| bash NPM |>>
91+
$ npm i -g @capawesome/cli
92+
<<| bash PNPM |>>
93+
$ pnpm add -g @capawesome/cli
94+
<<| bash Bun |>>
95+
$ bun install -g @capawesome/cli
8296
```
8397

8498
After installing the Capawesome CLI, you need to log in to your Capawesome Cloud account. Run the following command and follow the instructions:
@@ -95,4 +109,3 @@ npx capawesome apps:bundles:create --path src-capacitor/www
95109

96110
Congratulations! You have successfully published your first live update. You can now test it by running your app on a device or emulator. The app will check for updates and apply them if available.
97111
Feel free to check out the [documentation](https://capawesome.io/plugins/live-update/) of the Live Update plugin to see what else you can do with it.
98-

docs/src/pages/quasar-cli-webpack/developing-capacitor-apps/live-updates.md

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,15 @@ cd src-capacitor
1515

1616
Then, install the plugin:
1717

18-
```bash
19-
npm install @capawesome/capacitor-live-update
18+
```tabs
19+
<<| bash Yarn |>>
20+
$ yarn add @capawesome/capacitor-live-update
21+
<<| bash NPM |>>
22+
$ npm install --save @capawesome/capacitor-live-update
23+
<<| bash PNPM |>>
24+
$ pnpm add @capawesome/capacitor-live-update
25+
<<| bash Bun |>>
26+
$ bun add @capawesome/capacitor-live-update
2027
```
2128

2229
After that, you need to sync the changes with your native projects:
@@ -31,9 +38,9 @@ Next, you need to configure the plugin to work with [Capawesome Cloud](https://c
3138

3239
### App ID
3340

34-
In order for your app to identify itself to Capawesome Cloud, you need to set the `appId` in your `capacitor.config.ts` file. For this, you need to create an app on the [Capawesome Cloud Console](https://console.cloud.capawesome.io/) and get the App ID.
41+
In order for your app to identify itself to Capawesome Cloud, you need to set the `appId` in your `capacitor.config` file. For this, you need to create an app on the [Capawesome Cloud Console](https://console.cloud.capawesome.io/) and get the App ID.
3542

36-
```json
43+
```json /src-capacitor/capacitor.config file
3744
{
3845
"plugins": {
3946
"LiveUpdate": {
@@ -55,15 +62,15 @@ npx cap sync
5562

5663
The most basic usage of the Live Update plugin is to call the [`sync(...)`](https://capawesome.io/plugins/live-update/#sync) method when the app starts. This method checks for updates, downloads them if available, and sets them as the next bundle to be applied. You can then call the [`reload()`](https://capawesome.io/plugins/live-update/#reload) method to apply the update immediately. If the [`reload()`](https://capawesome.io/plugins/live-update/#reload) method is not called, the new bundle will be used on the next app start.
5764

58-
```ts
59-
import { LiveUpdate } from "@capawesome/capacitor-live-update";
65+
```js
66+
import { LiveUpdate } from "@capawesome/capacitor-live-update"
6067

6168
const sync = async () => {
62-
const result = await LiveUpdate.sync();
69+
const result = await LiveUpdate.sync()
6370
if (result.nextBundleId) {
64-
await LiveUpdate.reload();
71+
await LiveUpdate.reload()
6572
}
66-
};
73+
}
6774
```
6875

6976
## Publishing updates
@@ -77,8 +84,15 @@ quasar build -m capacitor -T [android|ios]
7784
This will create a `src-capacitor/www` folder with the build output of your web app. You can then upload this folder to Capawesome Cloud using the [Capawesome CLI](https://capawesome.io/cloud/cli/).
7885
To install the Capawesome CLI, run the following command:
7986

80-
```bash
81-
npm install -g @capawesome/cli
87+
```tabs
88+
<<| bash Yarn |>>
89+
$ yarn global add @capawesome/cli
90+
<<| bash NPM |>>
91+
$ npm i -g @capawesome/cli
92+
<<| bash PNPM |>>
93+
$ pnpm add -g @capawesome/cli
94+
<<| bash Bun |>>
95+
$ bun install -g @capawesome/cli
8296
```
8397

8498
After installing the Capawesome CLI, you need to log in to your Capawesome Cloud account. Run the following command and follow the instructions:
@@ -95,4 +109,3 @@ npx capawesome apps:bundles:create --path src-capacitor/www
95109

96110
Congratulations! You have successfully published your first live update. You can now test it by running your app on a device or emulator. The app will check for updates and apply them if available.
97111
Feel free to check out the [documentation](https://capawesome.io/plugins/live-update/) of the Live Update plugin to see what else you can do with it.
98-

0 commit comments

Comments
 (0)