@capawesome/capacitor-live-update 7.2.2 → 7.4.0-dev.f18299f8.1767510052
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +289 -28
- package/android/build.gradle +2 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/LiveUpdate.java +623 -220
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/LiveUpdateConfig.java +23 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/LiveUpdateHttpClient.java +42 -5
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/LiveUpdatePlugin.java +185 -15
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/LiveUpdatePreferences.java +42 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/api/GetLatestBundleResponse.java +2 -2
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/events/NextBundleSetEvent.java +26 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/options/SetConfigOptions.java +19 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/options/SyncOptions.java +4 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/results/GetBlockedBundlesResult.java +27 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/results/GetConfigResult.java +40 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/results/GetDownloadedBundlesResult.java +27 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/results/IsSyncingResult.java +26 -0
- package/dist/docs.json +428 -1
- package/dist/esm/definitions.d.ts +230 -2
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +8 -1
- package/dist/esm/web.js +21 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +21 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +21 -0
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/Classes/Events/NextBundleSetEvent.swift +16 -0
- package/ios/Plugin/Classes/Options/SetConfigOptions.swift +14 -0
- package/ios/Plugin/Classes/Options/SyncOptions.swift +4 -0
- package/ios/Plugin/Classes/Results/GetBlockedBundlesResult.swift +16 -0
- package/ios/Plugin/Classes/Results/GetConfigResult.swift +19 -0
- package/ios/Plugin/Classes/Results/GetDownloadedBundlesResult.swift +16 -0
- package/ios/Plugin/Classes/Results/IsSyncingResult.swift +16 -0
- package/ios/Plugin/LiveUpdate.swift +178 -4
- package/ios/Plugin/LiveUpdateConfig.swift +2 -0
- package/ios/Plugin/LiveUpdateHttpClient.swift +4 -2
- package/ios/Plugin/LiveUpdatePlugin.swift +106 -11
- package/ios/Plugin/LiveUpdatePreferences.swift +56 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Capacitor plugin that allows you to update your app remotely in real-time withou
|
|
|
4
4
|
|
|
5
5
|
<div class="capawesome-z29o10a">
|
|
6
6
|
<a href="https://cloud.capawesome.io/" target="_blank">
|
|
7
|
-
<img alt="Deliver Live Updates to your Capacitor app with Capawesome Cloud" src="https://cloud.capawesome.io/assets/banners/cloud-
|
|
7
|
+
<img alt="Deliver Live Updates to your Capacitor app with Capawesome Cloud" src="https://cloud.capawesome.io/assets/banners/cloud-build-and-deploy-capacitor-apps.png?t=1" />
|
|
8
8
|
</a>
|
|
9
9
|
</div>
|
|
10
10
|
|
|
@@ -17,16 +17,24 @@ We are proud to offer one of the most complete and feature-rich Capacitor plugin
|
|
|
17
17
|
- 📦 **Bundle Management**: Download, set, and delete bundles.
|
|
18
18
|
- ☁️ **Cloud Support**: Use the [Capawesome Cloud](https://cloud.capawesome.io/) to manage your app updates.
|
|
19
19
|
- 📺 **Channel Support**: Set a channel for the app to manage different versions.
|
|
20
|
-
- 🔄 **Auto Update**: Automatically download and set the latest bundle for the app.
|
|
20
|
+
- 🔄 **Auto Update**: Automatically download and set the latest bundle for the app with configurable background update strategy.
|
|
21
21
|
- 🛟 **Rollback**: Reset the app to the default bundle if an incompatible bundle has been set.
|
|
22
22
|
- 🚀 **Rollout**: Gradually roll out new bundles to gather valuable feedback.
|
|
23
23
|
- 🔁 **Delta Updates**: Make your updates faster by only downloading changed files.
|
|
24
24
|
- 🔒 **Security**: Verify the authenticity and integrity of the bundle using a public key.
|
|
25
|
-
- ⚔️ **Battle-Tested**: Used in more than
|
|
25
|
+
- ⚔️ **Battle-Tested**: Used in more than 1,000 projects to update apps on more than 20,000,000 devices.
|
|
26
26
|
- 🌐 **Open Source**: Licensed under the MIT License.
|
|
27
27
|
|
|
28
28
|
Missing a feature? Just [open an issue](https://github.com/capawesome-team/capacitor-plugins/issues) and we'll take a look!
|
|
29
29
|
|
|
30
|
+
## Compatibility
|
|
31
|
+
|
|
32
|
+
| Plugin Version | Capacitor Version | Status |
|
|
33
|
+
| -------------- | ----------------- | -------------- |
|
|
34
|
+
| 7.x.x | >=7.x.x | Active support |
|
|
35
|
+
| 6.x.x | 6.x.x | Maintenance |
|
|
36
|
+
| 5.x.x | 5.x.x | Deprecated |
|
|
37
|
+
|
|
30
38
|
## Guides
|
|
31
39
|
|
|
32
40
|
- [Announcing the Capacitor Live Update Plugin](https://capawesome.io/blog/announcing-the-capacitor-live-update-plugin/)
|
|
@@ -48,13 +56,16 @@ npx cap sync
|
|
|
48
56
|
|
|
49
57
|
#### Variables
|
|
50
58
|
|
|
51
|
-
If needed, you can define the following project variable in your app
|
|
59
|
+
If needed, you can define the following project variable in your app's `variables.gradle` file to change the default version of the dependency:
|
|
52
60
|
|
|
53
|
-
- `$okhttp3Version` version of `com.squareup.okhttp3:okhttp` (default: `
|
|
61
|
+
- `$okhttp3Version` version of `com.squareup.okhttp3:okhttp` (default: `4.12.0`)
|
|
54
62
|
- `$zip4jVersion` version of `net.lingala.zip4j:zip4j` (default: `2.11.5`)
|
|
63
|
+
- `$conscryptVersion` version of `org.conscrypt:conscrypt-android` (default: `2.5.3`)
|
|
55
64
|
|
|
56
65
|
This can be useful if you encounter dependency conflicts with other plugins in your project.
|
|
57
66
|
|
|
67
|
+
**Note**: The plugin uses Google Conscrypt as the security provider to ensure better SSL/TLS certificate compatibility on older Android versions (especially Android 7 and below).
|
|
68
|
+
|
|
58
69
|
### iOS
|
|
59
70
|
|
|
60
71
|
#### Privacy manifest
|
|
@@ -89,15 +100,17 @@ We recommend to declare [`CA92.1`](https://developer.apple.com/documentation/bun
|
|
|
89
100
|
<docgen-config>
|
|
90
101
|
<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
|
|
91
102
|
|
|
92
|
-
| Prop
|
|
93
|
-
|
|
|
94
|
-
| **`appId`**
|
|
95
|
-
| **`
|
|
96
|
-
| **`
|
|
97
|
-
| **`
|
|
98
|
-
| **`
|
|
99
|
-
| **`
|
|
100
|
-
| **`
|
|
103
|
+
| Prop | Type | Description | Default | Since |
|
|
104
|
+
| -------------------------------- | ----------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- | ----- |
|
|
105
|
+
| **`appId`** | <code>string</code> | The app ID is used to identify the app when using [Capawesome Cloud](https://capawesome.io/cloud/). This is **NOT** the same as the app identifier (e.g. `com.example.app`). This is a unique identifier generated by Capawesome Cloud (e.g. `6e351b4f-69a7-415e-a057-4567df7ffe94`). | | 5.0.0 |
|
|
106
|
+
| **`autoBlockRolledBackBundles`** | <code>boolean</code> | Whether or not to automatically block bundles that have been rolled back. When enabled, the plugin will automatically block bundles that caused a rollback (up to 100 bundles). When the limit is reached, the oldest blocked bundle is unblocked. Blocked bundles will be skipped in future sync operations. **Attention**: This option has no effect if `readyTimeout` is set to `0`. Only available on Android and iOS. | <code>false</code> | 7.3.0 |
|
|
107
|
+
| **`autoDeleteBundles`** | <code>boolean</code> | Whether or not to automatically delete unused bundles. When enabled, the plugin will automatically delete unused bundles after calling `ready()`. | <code>false</code> | 5.0.0 |
|
|
108
|
+
| **`autoUpdateStrategy`** | <code>'none' \| 'background'</code> | The auto-update strategy for live updates. - `none`: Live updates will not be applied automatically. - `background`: Live updates will be automatically downloaded and applied in the background at app startup and when the app resumes (if the last check was more than 15 minutes ago). Only available on Android and iOS. | <code>'none'</code> | 7.3.0 |
|
|
109
|
+
| **`defaultChannel`** | <code>string</code> | The default channel of the app. | | 6.3.0 |
|
|
110
|
+
| **`httpTimeout`** | <code>number</code> | The timeout in milliseconds for HTTP requests. | <code>60000</code> | 6.4.0 |
|
|
111
|
+
| **`publicKey`** | <code>string</code> | The public key to verify the integrity of the bundle. The public key must be a PEM-encoded RSA public key. | | 6.1.0 |
|
|
112
|
+
| **`readyTimeout`** | <code>number</code> | The timeout in milliseconds to wait for the app to be ready before resetting to the default bundle. It is strongly **recommended** to configure this option (e.g. `10000` ms) so that the plugin can roll back to the default bundle in case of problems. If configured, the plugin will wait for the app to call the `ready()` method before resetting to the default bundle. Set to `0` to disable the timeout. | <code>0</code> | 5.0.0 |
|
|
113
|
+
| **`serverDomain`** | <code>string</code> | The API domain of the [Capawesome Cloud](https://cloud.capawesome.io) server **without** scheme or path. | <code>'api.cloud.capawesome.io'</code> | 7.0.0 |
|
|
101
114
|
|
|
102
115
|
### Examples
|
|
103
116
|
|
|
@@ -108,7 +121,9 @@ In `capacitor.config.json`:
|
|
|
108
121
|
"plugins": {
|
|
109
122
|
"LiveUpdate": {
|
|
110
123
|
"appId": '6e351b4f-69a7-415e-a057-4567df7ffe94',
|
|
124
|
+
"autoBlockRolledBackBundles": undefined,
|
|
111
125
|
"autoDeleteBundles": undefined,
|
|
126
|
+
"autoUpdateStrategy": 'background',
|
|
112
127
|
"defaultChannel": 'production',
|
|
113
128
|
"httpTimeout": undefined,
|
|
114
129
|
"publicKey": '-----BEGIN PUBLIC KEY-----MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDodf1SD0OOn6hIlDuKBza0Ed0OqtwyVJwiyjmE9BJaZ7y8ZUfcF+SKmd0l2cDPM45XIg2tAFux5n29uoKyHwSt+6tCi5CJA5Z1/1eZruRRqABLonV77KS3HUtvOgqRLDnKSV89dYZkM++NwmzOPgIF422mvc+VukcVOBfc8/AHQIDAQAB-----END PUBLIC KEY-----',
|
|
@@ -130,7 +145,9 @@ const config: CapacitorConfig = {
|
|
|
130
145
|
plugins: {
|
|
131
146
|
LiveUpdate: {
|
|
132
147
|
appId: '6e351b4f-69a7-415e-a057-4567df7ffe94',
|
|
148
|
+
autoBlockRolledBackBundles: undefined,
|
|
133
149
|
autoDeleteBundles: undefined,
|
|
150
|
+
autoUpdateStrategy: 'background',
|
|
134
151
|
defaultChannel: 'production',
|
|
135
152
|
httpTimeout: undefined,
|
|
136
153
|
publicKey: '-----BEGIN PUBLIC KEY-----MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDodf1SD0OOn6hIlDuKBza0Ed0OqtwyVJwiyjmE9BJaZ7y8ZUfcF+SKmd0l2cDPM45XIg2tAFux5n29uoKyHwSt+6tCi5CJA5Z1/1eZruRRqABLonV77KS3HUtvOgqRLDnKSV89dYZkM++NwmzOPgIF422mvc+VukcVOBfc8/AHQIDAQAB-----END PUBLIC KEY-----',
|
|
@@ -145,20 +162,6 @@ export default config;
|
|
|
145
162
|
|
|
146
163
|
</docgen-config>
|
|
147
164
|
|
|
148
|
-
## Starter templates
|
|
149
|
-
|
|
150
|
-
The following starter templates are available:
|
|
151
|
-
|
|
152
|
-
- [Ionstarter Angular Firebase](https://ionstarter.dev/)
|
|
153
|
-
- [Ionstarter Angular SQLite](https://ionstarter.dev/)
|
|
154
|
-
|
|
155
|
-
## Guides
|
|
156
|
-
|
|
157
|
-
- [Announcing the Capacitor Live Update Plugin](https://capawesome.io/blog/announcing-the-capacitor-live-update-plugin/)
|
|
158
|
-
- [How Live Updates for Capacitor work](https://capawesome.io/blog/how-live-updates-for-capacitor-work/)
|
|
159
|
-
- [How to restrict Capacitor Live Updates to Native Versions](https://capawesome.io/blog/how-to-restrict-capacitor-live-updates-to-native-versions/)
|
|
160
|
-
- [How to gradually roll out Capacitor Live Updates](https://capawesome.io/blog/how-to-gradually-roll-out-capacitor-live-updates/)
|
|
161
|
-
|
|
162
165
|
## Usage
|
|
163
166
|
|
|
164
167
|
```typescript
|
|
@@ -273,25 +276,34 @@ const isNewBundleAvailable = async () => {
|
|
|
273
276
|
|
|
274
277
|
<docgen-index>
|
|
275
278
|
|
|
279
|
+
* [`clearBlockedBundles()`](#clearblockedbundles)
|
|
276
280
|
* [`deleteBundle(...)`](#deletebundle)
|
|
277
281
|
* [`downloadBundle(...)`](#downloadbundle)
|
|
278
282
|
* [`fetchLatestBundle(...)`](#fetchlatestbundle)
|
|
283
|
+
* [`getBlockedBundles()`](#getblockedbundles)
|
|
279
284
|
* [`getBundles()`](#getbundles)
|
|
280
285
|
* [`getChannel()`](#getchannel)
|
|
286
|
+
* [`getConfig()`](#getconfig)
|
|
287
|
+
* [`getDownloadedBundles()`](#getdownloadedbundles)
|
|
281
288
|
* [`getCurrentBundle()`](#getcurrentbundle)
|
|
282
289
|
* [`getCustomId()`](#getcustomid)
|
|
283
290
|
* [`getDeviceId()`](#getdeviceid)
|
|
291
|
+
* [`isSyncing()`](#issyncing)
|
|
284
292
|
* [`getNextBundle()`](#getnextbundle)
|
|
285
293
|
* [`getVersionCode()`](#getversioncode)
|
|
286
294
|
* [`getVersionName()`](#getversionname)
|
|
287
295
|
* [`ready()`](#ready)
|
|
288
296
|
* [`reload()`](#reload)
|
|
289
297
|
* [`reset()`](#reset)
|
|
298
|
+
* [`resetConfig()`](#resetconfig)
|
|
290
299
|
* [`setChannel(...)`](#setchannel)
|
|
300
|
+
* [`setConfig(...)`](#setconfig)
|
|
291
301
|
* [`setCustomId(...)`](#setcustomid)
|
|
292
302
|
* [`setNextBundle(...)`](#setnextbundle)
|
|
293
303
|
* [`sync(...)`](#sync)
|
|
294
304
|
* [`addListener('downloadBundleProgress', ...)`](#addlistenerdownloadbundleprogress-)
|
|
305
|
+
* [`addListener('nextBundleSet', ...)`](#addlistenernextbundleset-)
|
|
306
|
+
* [`addListener('reloaded', ...)`](#addlistenerreloaded-)
|
|
295
307
|
* [`removeAllListeners()`](#removealllisteners)
|
|
296
308
|
* [Interfaces](#interfaces)
|
|
297
309
|
* [Type Aliases](#type-aliases)
|
|
@@ -301,6 +313,24 @@ const isNewBundleAvailable = async () => {
|
|
|
301
313
|
<docgen-api>
|
|
302
314
|
<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
|
|
303
315
|
|
|
316
|
+
### clearBlockedBundles()
|
|
317
|
+
|
|
318
|
+
```typescript
|
|
319
|
+
clearBlockedBundles() => Promise<void>
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
Clear all blocked bundles from the blocked list.
|
|
323
|
+
|
|
324
|
+
This removes all bundle identifiers that were automatically blocked
|
|
325
|
+
due to rollbacks when `autoBlockRolledBackBundles` is enabled.
|
|
326
|
+
|
|
327
|
+
Only available on Android and iOS.
|
|
328
|
+
|
|
329
|
+
**Since:** 7.4.0
|
|
330
|
+
|
|
331
|
+
--------------------
|
|
332
|
+
|
|
333
|
+
|
|
304
334
|
### deleteBundle(...)
|
|
305
335
|
|
|
306
336
|
```typescript
|
|
@@ -360,6 +390,26 @@ Only available on Android and iOS.
|
|
|
360
390
|
--------------------
|
|
361
391
|
|
|
362
392
|
|
|
393
|
+
### getBlockedBundles()
|
|
394
|
+
|
|
395
|
+
```typescript
|
|
396
|
+
getBlockedBundles() => Promise<GetBlockedBundlesResult>
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
Get all blocked bundle identifiers.
|
|
400
|
+
|
|
401
|
+
Returns the list of bundle identifiers that were automatically blocked
|
|
402
|
+
due to rollbacks when `autoBlockRolledBackBundles` is enabled.
|
|
403
|
+
|
|
404
|
+
Only available on Android and iOS.
|
|
405
|
+
|
|
406
|
+
**Returns:** <code>Promise<<a href="#getblockedbundlesresult">GetBlockedBundlesResult</a>></code>
|
|
407
|
+
|
|
408
|
+
**Since:** 7.4.0
|
|
409
|
+
|
|
410
|
+
--------------------
|
|
411
|
+
|
|
412
|
+
|
|
363
413
|
### getBundles()
|
|
364
414
|
|
|
365
415
|
```typescript
|
|
@@ -394,6 +444,43 @@ Only available on Android and iOS.
|
|
|
394
444
|
--------------------
|
|
395
445
|
|
|
396
446
|
|
|
447
|
+
### getConfig()
|
|
448
|
+
|
|
449
|
+
```typescript
|
|
450
|
+
getConfig() => Promise<GetConfigResult>
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
Get the runtime configuration.
|
|
454
|
+
|
|
455
|
+
Returns the current plugin configuration including any runtime
|
|
456
|
+
overrides set via `setConfig()`.
|
|
457
|
+
|
|
458
|
+
Only available on Android and iOS.
|
|
459
|
+
|
|
460
|
+
**Returns:** <code>Promise<<a href="#getconfigresult">GetConfigResult</a>></code>
|
|
461
|
+
|
|
462
|
+
**Since:** 7.4.0
|
|
463
|
+
|
|
464
|
+
--------------------
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
### getDownloadedBundles()
|
|
468
|
+
|
|
469
|
+
```typescript
|
|
470
|
+
getDownloadedBundles() => Promise<GetDownloadedBundlesResult>
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
Get all identifiers of bundles that have been downloaded.
|
|
474
|
+
|
|
475
|
+
Only available on Android and iOS.
|
|
476
|
+
|
|
477
|
+
**Returns:** <code>Promise<<a href="#getdownloadedbundlesresult">GetDownloadedBundlesResult</a>></code>
|
|
478
|
+
|
|
479
|
+
**Since:** 7.4.0
|
|
480
|
+
|
|
481
|
+
--------------------
|
|
482
|
+
|
|
483
|
+
|
|
397
484
|
### getCurrentBundle()
|
|
398
485
|
|
|
399
486
|
```typescript
|
|
@@ -446,6 +533,23 @@ Only available on Android and iOS.
|
|
|
446
533
|
--------------------
|
|
447
534
|
|
|
448
535
|
|
|
536
|
+
### isSyncing()
|
|
537
|
+
|
|
538
|
+
```typescript
|
|
539
|
+
isSyncing() => Promise<IsSyncingResult>
|
|
540
|
+
```
|
|
541
|
+
|
|
542
|
+
Check whether a sync operation is currently in progress.
|
|
543
|
+
|
|
544
|
+
Only available on Android and iOS.
|
|
545
|
+
|
|
546
|
+
**Returns:** <code>Promise<<a href="#issyncingresult">IsSyncingResult</a>></code>
|
|
547
|
+
|
|
548
|
+
**Since:** 7.4.0
|
|
549
|
+
|
|
550
|
+
--------------------
|
|
551
|
+
|
|
552
|
+
|
|
449
553
|
### getNextBundle()
|
|
450
554
|
|
|
451
555
|
```typescript
|
|
@@ -557,6 +661,24 @@ Only available on Android and iOS.
|
|
|
557
661
|
--------------------
|
|
558
662
|
|
|
559
663
|
|
|
664
|
+
### resetConfig()
|
|
665
|
+
|
|
666
|
+
```typescript
|
|
667
|
+
resetConfig() => Promise<void>
|
|
668
|
+
```
|
|
669
|
+
|
|
670
|
+
Reset the runtime configuration to the values from the Capacitor config file.
|
|
671
|
+
|
|
672
|
+
This clears any runtime configuration set via `setConfig()`.
|
|
673
|
+
The changes take effect immediately.
|
|
674
|
+
|
|
675
|
+
Only available on Android and iOS.
|
|
676
|
+
|
|
677
|
+
**Since:** 7.4.0
|
|
678
|
+
|
|
679
|
+
--------------------
|
|
680
|
+
|
|
681
|
+
|
|
560
682
|
### setChannel(...)
|
|
561
683
|
|
|
562
684
|
```typescript
|
|
@@ -576,6 +698,32 @@ Only available on Android and iOS.
|
|
|
576
698
|
--------------------
|
|
577
699
|
|
|
578
700
|
|
|
701
|
+
### setConfig(...)
|
|
702
|
+
|
|
703
|
+
```typescript
|
|
704
|
+
setConfig(options: SetConfigOptions) => Promise<void>
|
|
705
|
+
```
|
|
706
|
+
|
|
707
|
+
Set the runtime configuration.
|
|
708
|
+
|
|
709
|
+
This allows updating plugin configuration options at runtime.
|
|
710
|
+
The changes are persisted across app restarts and take effect immediately.
|
|
711
|
+
|
|
712
|
+
**Important:** Runtime configuration is automatically reset to default values
|
|
713
|
+
whenever the native app is updated to a new version. This ensures that
|
|
714
|
+
configuration from previous versions doesn't persist after an app update.
|
|
715
|
+
|
|
716
|
+
Only available on Android and iOS.
|
|
717
|
+
|
|
718
|
+
| Param | Type |
|
|
719
|
+
| ------------- | ------------------------------------------------------------- |
|
|
720
|
+
| **`options`** | <code><a href="#setconfigoptions">SetConfigOptions</a></code> |
|
|
721
|
+
|
|
722
|
+
**Since:** 7.4.0
|
|
723
|
+
|
|
724
|
+
--------------------
|
|
725
|
+
|
|
726
|
+
|
|
579
727
|
### setCustomId(...)
|
|
580
728
|
|
|
581
729
|
```typescript
|
|
@@ -661,6 +809,60 @@ Only available on Android and iOS.
|
|
|
661
809
|
--------------------
|
|
662
810
|
|
|
663
811
|
|
|
812
|
+
### addListener('nextBundleSet', ...)
|
|
813
|
+
|
|
814
|
+
```typescript
|
|
815
|
+
addListener(eventName: 'nextBundleSet', listenerFunc: NextBundleSetListener) => Promise<PluginListenerHandle>
|
|
816
|
+
```
|
|
817
|
+
|
|
818
|
+
Listen for when a bundle is set as the next bundle.
|
|
819
|
+
|
|
820
|
+
This event is triggered whenever a bundle is set to be used on the next app restart,
|
|
821
|
+
either through automatic updates or manual calls to `setNextBundle()`.
|
|
822
|
+
|
|
823
|
+
Only available on Android and iOS.
|
|
824
|
+
|
|
825
|
+
| Param | Type |
|
|
826
|
+
| ------------------ | ----------------------------------------------------------------------- |
|
|
827
|
+
| **`eventName`** | <code>'nextBundleSet'</code> |
|
|
828
|
+
| **`listenerFunc`** | <code><a href="#nextbundlesetlistener">NextBundleSetListener</a></code> |
|
|
829
|
+
|
|
830
|
+
**Returns:** <code>Promise<<a href="#pluginlistenerhandle">PluginListenerHandle</a>></code>
|
|
831
|
+
|
|
832
|
+
**Since:** 7.3.0
|
|
833
|
+
|
|
834
|
+
--------------------
|
|
835
|
+
|
|
836
|
+
|
|
837
|
+
### addListener('reloaded', ...)
|
|
838
|
+
|
|
839
|
+
```typescript
|
|
840
|
+
addListener(eventName: 'reloaded', listenerFunc: ReloadedListener) => Promise<PluginListenerHandle>
|
|
841
|
+
```
|
|
842
|
+
|
|
843
|
+
Listen for when the app is reloaded.
|
|
844
|
+
|
|
845
|
+
This event is triggered after the `reload()` method is called
|
|
846
|
+
and the app has been reloaded.
|
|
847
|
+
|
|
848
|
+
**Note:** To verify whether an update was successfully applied after a reload,
|
|
849
|
+
use the `ready()` method instead. The `ready()` method provides detailed information
|
|
850
|
+
about the current bundle, previous bundle, and whether a rollback occurred.
|
|
851
|
+
|
|
852
|
+
Only available on Android and iOS.
|
|
853
|
+
|
|
854
|
+
| Param | Type |
|
|
855
|
+
| ------------------ | ------------------------------------------------------------- |
|
|
856
|
+
| **`eventName`** | <code>'reloaded'</code> |
|
|
857
|
+
| **`listenerFunc`** | <code><a href="#reloadedlistener">ReloadedListener</a></code> |
|
|
858
|
+
|
|
859
|
+
**Returns:** <code>Promise<<a href="#pluginlistenerhandle">PluginListenerHandle</a>></code>
|
|
860
|
+
|
|
861
|
+
**Since:** 7.4.0
|
|
862
|
+
|
|
863
|
+
--------------------
|
|
864
|
+
|
|
865
|
+
|
|
664
866
|
### removeAllListeners()
|
|
665
867
|
|
|
666
868
|
```typescript
|
|
@@ -714,6 +916,13 @@ Remove all listeners for this plugin.
|
|
|
714
916
|
| **`channel`** | <code>string</code> | The name of the channel where the latest bundle is fetched from. | 6.7.0 |
|
|
715
917
|
|
|
716
918
|
|
|
919
|
+
#### GetBlockedBundlesResult
|
|
920
|
+
|
|
921
|
+
| Prop | Type | Description | Since |
|
|
922
|
+
| --------------- | --------------------- | ------------------------------------------------------ | ----- |
|
|
923
|
+
| **`bundleIds`** | <code>string[]</code> | An array of unique identifiers of all blocked bundles. | 7.4.0 |
|
|
924
|
+
|
|
925
|
+
|
|
717
926
|
#### GetBundlesResult
|
|
718
927
|
|
|
719
928
|
| Prop | Type | Description | Since |
|
|
@@ -728,6 +937,21 @@ Remove all listeners for this plugin.
|
|
|
728
937
|
| **`channel`** | <code>string \| null</code> | The channel name. If `null`, the app is using the default channel. | 5.0.0 |
|
|
729
938
|
|
|
730
939
|
|
|
940
|
+
#### GetConfigResult
|
|
941
|
+
|
|
942
|
+
| Prop | Type | Description | Since |
|
|
943
|
+
| ------------------------ | ----------------------------------- | ------------------------------------------------------------------------ | ----- |
|
|
944
|
+
| **`appId`** | <code>string \| null</code> | The app ID used to identify the app. If `null`, no app ID is configured. | 7.4.0 |
|
|
945
|
+
| **`autoUpdateStrategy`** | <code>'none' \| 'background'</code> | The auto-update strategy for live updates. | 7.4.0 |
|
|
946
|
+
|
|
947
|
+
|
|
948
|
+
#### GetDownloadedBundlesResult
|
|
949
|
+
|
|
950
|
+
| Prop | Type | Description | Since |
|
|
951
|
+
| --------------- | --------------------- | --------------------------------------------------------- | ----- |
|
|
952
|
+
| **`bundleIds`** | <code>string[]</code> | An array of unique identifiers of all downloaded bundles. | 7.4.0 |
|
|
953
|
+
|
|
954
|
+
|
|
731
955
|
#### GetCurrentBundleResult
|
|
732
956
|
|
|
733
957
|
| Prop | Type | Description | Since |
|
|
@@ -749,6 +973,13 @@ Remove all listeners for this plugin.
|
|
|
749
973
|
| **`deviceId`** | <code>string</code> | The unique identifier of the device. On iOS, [`identifierForVendor`](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor) is used. The value of this property is the same for apps that come from the same vendor running on the same device. | 5.0.0 |
|
|
750
974
|
|
|
751
975
|
|
|
976
|
+
#### IsSyncingResult
|
|
977
|
+
|
|
978
|
+
| Prop | Type | Description | Since |
|
|
979
|
+
| ------------- | -------------------- | -------------------------------------------------- | ----- |
|
|
980
|
+
| **`syncing`** | <code>boolean</code> | Whether a sync operation is currently in progress. | 7.4.0 |
|
|
981
|
+
|
|
982
|
+
|
|
752
983
|
#### GetNextBundleResult
|
|
753
984
|
|
|
754
985
|
| Prop | Type | Description | Since |
|
|
@@ -786,6 +1017,13 @@ Remove all listeners for this plugin.
|
|
|
786
1017
|
| **`channel`** | <code>string \| null</code> | The channel name. Set `null` to remove the channel. | 5.0.0 |
|
|
787
1018
|
|
|
788
1019
|
|
|
1020
|
+
#### SetConfigOptions
|
|
1021
|
+
|
|
1022
|
+
| Prop | Type | Description | Since |
|
|
1023
|
+
| ----------- | --------------------------- | ----------------------------------------------------------------------------------------------------- | ----- |
|
|
1024
|
+
| **`appId`** | <code>string \| null</code> | The app ID used to identify the app. Set `null` to reset to the value from the Capacitor config file. | 7.4.0 |
|
|
1025
|
+
|
|
1026
|
+
|
|
789
1027
|
#### SetCustomIdOptions
|
|
790
1028
|
|
|
791
1029
|
| Prop | Type | Description | Since |
|
|
@@ -833,6 +1071,15 @@ Event that is triggered when the download progress of a bundle changes.
|
|
|
833
1071
|
| **`totalBytes`** | <code>number</code> | The total number of bytes to download. | 7.0.0 |
|
|
834
1072
|
|
|
835
1073
|
|
|
1074
|
+
#### NextBundleSetEvent
|
|
1075
|
+
|
|
1076
|
+
Event that is triggered when a bundle is set as the next bundle.
|
|
1077
|
+
|
|
1078
|
+
| Prop | Type | Description | Since |
|
|
1079
|
+
| -------------- | --------------------------- | --------------------------------------------------------------------------------------------------------------- | ----- |
|
|
1080
|
+
| **`bundleId`** | <code>string \| null</code> | The unique identifier of the bundle that is set as the next bundle. If `null`, the default bundle will be used. | 7.3.0 |
|
|
1081
|
+
|
|
1082
|
+
|
|
836
1083
|
### Type Aliases
|
|
837
1084
|
|
|
838
1085
|
|
|
@@ -842,6 +1089,20 @@ Listener for the download progress of a bundle.
|
|
|
842
1089
|
|
|
843
1090
|
<code>(event: <a href="#downloadbundleprogressevent">DownloadBundleProgressEvent</a>): void</code>
|
|
844
1091
|
|
|
1092
|
+
|
|
1093
|
+
#### NextBundleSetListener
|
|
1094
|
+
|
|
1095
|
+
Listener for when a bundle is set as the next bundle.
|
|
1096
|
+
|
|
1097
|
+
<code>(event: <a href="#nextbundlesetevent">NextBundleSetEvent</a>): void</code>
|
|
1098
|
+
|
|
1099
|
+
|
|
1100
|
+
#### ReloadedListener
|
|
1101
|
+
|
|
1102
|
+
Listener for when the app is reloaded.
|
|
1103
|
+
|
|
1104
|
+
<code>(): void</code>
|
|
1105
|
+
|
|
845
1106
|
</docgen-api>
|
|
846
1107
|
|
|
847
1108
|
## Testing
|
package/android/build.gradle
CHANGED
|
@@ -5,6 +5,7 @@ ext {
|
|
|
5
5
|
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1'
|
|
6
6
|
okhttp3Version = project.hasProperty('okhttp3Version') ? rootProject.ext.okhttp3Version : '4.12.0'
|
|
7
7
|
zip4jVersion = project.hasProperty('zip4jVersion') ? rootProject.ext.zip4jVersion : '2.11.5'
|
|
8
|
+
conscryptVersion = project.hasProperty('conscryptVersion') ? rootProject.ext.conscryptVersion : '2.5.3'
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
buildscript {
|
|
@@ -56,6 +57,7 @@ dependencies {
|
|
|
56
57
|
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
|
|
57
58
|
implementation "net.lingala.zip4j:zip4j:$zip4jVersion"
|
|
58
59
|
implementation "com.squareup.okhttp3:okhttp:$okhttp3Version"
|
|
60
|
+
implementation "org.conscrypt:conscrypt-android:$conscryptVersion"
|
|
59
61
|
testImplementation "junit:junit:$junitVersion"
|
|
60
62
|
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
|
|
61
63
|
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
|