@capawesome/capacitor-live-update 7.3.0 → 7.4.0
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 +216 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/LiveUpdate.java +519 -246
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/LiveUpdateHttpClient.java +33 -5
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/LiveUpdatePlugin.java +134 -3
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/LiveUpdatePreferences.java +25 -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/options/SetConfigOptions.java +19 -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 +319 -0
- package/dist/esm/definitions.d.ts +165 -0
- 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/Options/SetConfigOptions.swift +14 -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 +77 -4
- package/ios/Plugin/LiveUpdatePlugin.swift +78 -1
- package/ios/Plugin/LiveUpdatePreferences.swift +44 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -273,26 +273,34 @@ const isNewBundleAvailable = async () => {
|
|
|
273
273
|
|
|
274
274
|
<docgen-index>
|
|
275
275
|
|
|
276
|
+
* [`clearBlockedBundles()`](#clearblockedbundles)
|
|
276
277
|
* [`deleteBundle(...)`](#deletebundle)
|
|
277
278
|
* [`downloadBundle(...)`](#downloadbundle)
|
|
278
279
|
* [`fetchLatestBundle(...)`](#fetchlatestbundle)
|
|
280
|
+
* [`getBlockedBundles()`](#getblockedbundles)
|
|
279
281
|
* [`getBundles()`](#getbundles)
|
|
280
282
|
* [`getChannel()`](#getchannel)
|
|
283
|
+
* [`getConfig()`](#getconfig)
|
|
284
|
+
* [`getDownloadedBundles()`](#getdownloadedbundles)
|
|
281
285
|
* [`getCurrentBundle()`](#getcurrentbundle)
|
|
282
286
|
* [`getCustomId()`](#getcustomid)
|
|
283
287
|
* [`getDeviceId()`](#getdeviceid)
|
|
288
|
+
* [`isSyncing()`](#issyncing)
|
|
284
289
|
* [`getNextBundle()`](#getnextbundle)
|
|
285
290
|
* [`getVersionCode()`](#getversioncode)
|
|
286
291
|
* [`getVersionName()`](#getversionname)
|
|
287
292
|
* [`ready()`](#ready)
|
|
288
293
|
* [`reload()`](#reload)
|
|
289
294
|
* [`reset()`](#reset)
|
|
295
|
+
* [`resetConfig()`](#resetconfig)
|
|
290
296
|
* [`setChannel(...)`](#setchannel)
|
|
297
|
+
* [`setConfig(...)`](#setconfig)
|
|
291
298
|
* [`setCustomId(...)`](#setcustomid)
|
|
292
299
|
* [`setNextBundle(...)`](#setnextbundle)
|
|
293
300
|
* [`sync(...)`](#sync)
|
|
294
301
|
* [`addListener('downloadBundleProgress', ...)`](#addlistenerdownloadbundleprogress-)
|
|
295
302
|
* [`addListener('nextBundleSet', ...)`](#addlistenernextbundleset-)
|
|
303
|
+
* [`addListener('reloaded', ...)`](#addlistenerreloaded-)
|
|
296
304
|
* [`removeAllListeners()`](#removealllisteners)
|
|
297
305
|
* [Interfaces](#interfaces)
|
|
298
306
|
* [Type Aliases](#type-aliases)
|
|
@@ -302,6 +310,24 @@ const isNewBundleAvailable = async () => {
|
|
|
302
310
|
<docgen-api>
|
|
303
311
|
<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
|
|
304
312
|
|
|
313
|
+
### clearBlockedBundles()
|
|
314
|
+
|
|
315
|
+
```typescript
|
|
316
|
+
clearBlockedBundles() => Promise<void>
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
Clear all blocked bundles from the blocked list.
|
|
320
|
+
|
|
321
|
+
This removes all bundle identifiers that were automatically blocked
|
|
322
|
+
due to rollbacks when `autoBlockRolledBackBundles` is enabled.
|
|
323
|
+
|
|
324
|
+
Only available on Android and iOS.
|
|
325
|
+
|
|
326
|
+
**Since:** 7.4.0
|
|
327
|
+
|
|
328
|
+
--------------------
|
|
329
|
+
|
|
330
|
+
|
|
305
331
|
### deleteBundle(...)
|
|
306
332
|
|
|
307
333
|
```typescript
|
|
@@ -361,6 +387,26 @@ Only available on Android and iOS.
|
|
|
361
387
|
--------------------
|
|
362
388
|
|
|
363
389
|
|
|
390
|
+
### getBlockedBundles()
|
|
391
|
+
|
|
392
|
+
```typescript
|
|
393
|
+
getBlockedBundles() => Promise<GetBlockedBundlesResult>
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
Get all blocked bundle identifiers.
|
|
397
|
+
|
|
398
|
+
Returns the list of bundle identifiers that were automatically blocked
|
|
399
|
+
due to rollbacks when `autoBlockRolledBackBundles` is enabled.
|
|
400
|
+
|
|
401
|
+
Only available on Android and iOS.
|
|
402
|
+
|
|
403
|
+
**Returns:** <code>Promise<<a href="#getblockedbundlesresult">GetBlockedBundlesResult</a>></code>
|
|
404
|
+
|
|
405
|
+
**Since:** 7.4.0
|
|
406
|
+
|
|
407
|
+
--------------------
|
|
408
|
+
|
|
409
|
+
|
|
364
410
|
### getBundles()
|
|
365
411
|
|
|
366
412
|
```typescript
|
|
@@ -395,6 +441,43 @@ Only available on Android and iOS.
|
|
|
395
441
|
--------------------
|
|
396
442
|
|
|
397
443
|
|
|
444
|
+
### getConfig()
|
|
445
|
+
|
|
446
|
+
```typescript
|
|
447
|
+
getConfig() => Promise<GetConfigResult>
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
Get the runtime configuration.
|
|
451
|
+
|
|
452
|
+
Returns the current plugin configuration including any runtime
|
|
453
|
+
overrides set via `setConfig()`.
|
|
454
|
+
|
|
455
|
+
Only available on Android and iOS.
|
|
456
|
+
|
|
457
|
+
**Returns:** <code>Promise<<a href="#getconfigresult">GetConfigResult</a>></code>
|
|
458
|
+
|
|
459
|
+
**Since:** 7.4.0
|
|
460
|
+
|
|
461
|
+
--------------------
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
### getDownloadedBundles()
|
|
465
|
+
|
|
466
|
+
```typescript
|
|
467
|
+
getDownloadedBundles() => Promise<GetDownloadedBundlesResult>
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
Get all identifiers of bundles that have been downloaded.
|
|
471
|
+
|
|
472
|
+
Only available on Android and iOS.
|
|
473
|
+
|
|
474
|
+
**Returns:** <code>Promise<<a href="#getdownloadedbundlesresult">GetDownloadedBundlesResult</a>></code>
|
|
475
|
+
|
|
476
|
+
**Since:** 7.4.0
|
|
477
|
+
|
|
478
|
+
--------------------
|
|
479
|
+
|
|
480
|
+
|
|
398
481
|
### getCurrentBundle()
|
|
399
482
|
|
|
400
483
|
```typescript
|
|
@@ -447,6 +530,23 @@ Only available on Android and iOS.
|
|
|
447
530
|
--------------------
|
|
448
531
|
|
|
449
532
|
|
|
533
|
+
### isSyncing()
|
|
534
|
+
|
|
535
|
+
```typescript
|
|
536
|
+
isSyncing() => Promise<IsSyncingResult>
|
|
537
|
+
```
|
|
538
|
+
|
|
539
|
+
Check whether a sync operation is currently in progress.
|
|
540
|
+
|
|
541
|
+
Only available on Android and iOS.
|
|
542
|
+
|
|
543
|
+
**Returns:** <code>Promise<<a href="#issyncingresult">IsSyncingResult</a>></code>
|
|
544
|
+
|
|
545
|
+
**Since:** 7.4.0
|
|
546
|
+
|
|
547
|
+
--------------------
|
|
548
|
+
|
|
549
|
+
|
|
450
550
|
### getNextBundle()
|
|
451
551
|
|
|
452
552
|
```typescript
|
|
@@ -558,6 +658,24 @@ Only available on Android and iOS.
|
|
|
558
658
|
--------------------
|
|
559
659
|
|
|
560
660
|
|
|
661
|
+
### resetConfig()
|
|
662
|
+
|
|
663
|
+
```typescript
|
|
664
|
+
resetConfig() => Promise<void>
|
|
665
|
+
```
|
|
666
|
+
|
|
667
|
+
Reset the runtime configuration to the values from the Capacitor config file.
|
|
668
|
+
|
|
669
|
+
This clears any runtime configuration set via `setConfig()`.
|
|
670
|
+
The changes take effect immediately.
|
|
671
|
+
|
|
672
|
+
Only available on Android and iOS.
|
|
673
|
+
|
|
674
|
+
**Since:** 7.4.0
|
|
675
|
+
|
|
676
|
+
--------------------
|
|
677
|
+
|
|
678
|
+
|
|
561
679
|
### setChannel(...)
|
|
562
680
|
|
|
563
681
|
```typescript
|
|
@@ -577,6 +695,32 @@ Only available on Android and iOS.
|
|
|
577
695
|
--------------------
|
|
578
696
|
|
|
579
697
|
|
|
698
|
+
### setConfig(...)
|
|
699
|
+
|
|
700
|
+
```typescript
|
|
701
|
+
setConfig(options: SetConfigOptions) => Promise<void>
|
|
702
|
+
```
|
|
703
|
+
|
|
704
|
+
Set the runtime configuration.
|
|
705
|
+
|
|
706
|
+
This allows updating plugin configuration options at runtime.
|
|
707
|
+
The changes are persisted across app restarts and take effect immediately.
|
|
708
|
+
|
|
709
|
+
**Important:** Runtime configuration is automatically reset to default values
|
|
710
|
+
whenever the native app is updated to a new version. This ensures that
|
|
711
|
+
configuration from previous versions doesn't persist after an app update.
|
|
712
|
+
|
|
713
|
+
Only available on Android and iOS.
|
|
714
|
+
|
|
715
|
+
| Param | Type |
|
|
716
|
+
| ------------- | ------------------------------------------------------------- |
|
|
717
|
+
| **`options`** | <code><a href="#setconfigoptions">SetConfigOptions</a></code> |
|
|
718
|
+
|
|
719
|
+
**Since:** 7.4.0
|
|
720
|
+
|
|
721
|
+
--------------------
|
|
722
|
+
|
|
723
|
+
|
|
580
724
|
### setCustomId(...)
|
|
581
725
|
|
|
582
726
|
```typescript
|
|
@@ -687,6 +831,35 @@ Only available on Android and iOS.
|
|
|
687
831
|
--------------------
|
|
688
832
|
|
|
689
833
|
|
|
834
|
+
### addListener('reloaded', ...)
|
|
835
|
+
|
|
836
|
+
```typescript
|
|
837
|
+
addListener(eventName: 'reloaded', listenerFunc: ReloadedListener) => Promise<PluginListenerHandle>
|
|
838
|
+
```
|
|
839
|
+
|
|
840
|
+
Listen for when the app is reloaded.
|
|
841
|
+
|
|
842
|
+
This event is triggered after the `reload()` method is called
|
|
843
|
+
and the app has been reloaded.
|
|
844
|
+
|
|
845
|
+
**Note:** To verify whether an update was successfully applied after a reload,
|
|
846
|
+
use the `ready()` method instead. The `ready()` method provides detailed information
|
|
847
|
+
about the current bundle, previous bundle, and whether a rollback occurred.
|
|
848
|
+
|
|
849
|
+
Only available on Android and iOS.
|
|
850
|
+
|
|
851
|
+
| Param | Type |
|
|
852
|
+
| ------------------ | ------------------------------------------------------------- |
|
|
853
|
+
| **`eventName`** | <code>'reloaded'</code> |
|
|
854
|
+
| **`listenerFunc`** | <code><a href="#reloadedlistener">ReloadedListener</a></code> |
|
|
855
|
+
|
|
856
|
+
**Returns:** <code>Promise<<a href="#pluginlistenerhandle">PluginListenerHandle</a>></code>
|
|
857
|
+
|
|
858
|
+
**Since:** 7.4.0
|
|
859
|
+
|
|
860
|
+
--------------------
|
|
861
|
+
|
|
862
|
+
|
|
690
863
|
### removeAllListeners()
|
|
691
864
|
|
|
692
865
|
```typescript
|
|
@@ -740,6 +913,13 @@ Remove all listeners for this plugin.
|
|
|
740
913
|
| **`channel`** | <code>string</code> | The name of the channel where the latest bundle is fetched from. | 6.7.0 |
|
|
741
914
|
|
|
742
915
|
|
|
916
|
+
#### GetBlockedBundlesResult
|
|
917
|
+
|
|
918
|
+
| Prop | Type | Description | Since |
|
|
919
|
+
| --------------- | --------------------- | ------------------------------------------------------ | ----- |
|
|
920
|
+
| **`bundleIds`** | <code>string[]</code> | An array of unique identifiers of all blocked bundles. | 7.4.0 |
|
|
921
|
+
|
|
922
|
+
|
|
743
923
|
#### GetBundlesResult
|
|
744
924
|
|
|
745
925
|
| Prop | Type | Description | Since |
|
|
@@ -754,6 +934,21 @@ Remove all listeners for this plugin.
|
|
|
754
934
|
| **`channel`** | <code>string \| null</code> | The channel name. If `null`, the app is using the default channel. | 5.0.0 |
|
|
755
935
|
|
|
756
936
|
|
|
937
|
+
#### GetConfigResult
|
|
938
|
+
|
|
939
|
+
| Prop | Type | Description | Since |
|
|
940
|
+
| ------------------------ | ----------------------------------- | ------------------------------------------------------------------------ | ----- |
|
|
941
|
+
| **`appId`** | <code>string \| null</code> | The app ID used to identify the app. If `null`, no app ID is configured. | 7.4.0 |
|
|
942
|
+
| **`autoUpdateStrategy`** | <code>'none' \| 'background'</code> | The auto-update strategy for live updates. | 7.4.0 |
|
|
943
|
+
|
|
944
|
+
|
|
945
|
+
#### GetDownloadedBundlesResult
|
|
946
|
+
|
|
947
|
+
| Prop | Type | Description | Since |
|
|
948
|
+
| --------------- | --------------------- | --------------------------------------------------------- | ----- |
|
|
949
|
+
| **`bundleIds`** | <code>string[]</code> | An array of unique identifiers of all downloaded bundles. | 7.4.0 |
|
|
950
|
+
|
|
951
|
+
|
|
757
952
|
#### GetCurrentBundleResult
|
|
758
953
|
|
|
759
954
|
| Prop | Type | Description | Since |
|
|
@@ -775,6 +970,13 @@ Remove all listeners for this plugin.
|
|
|
775
970
|
| **`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 |
|
|
776
971
|
|
|
777
972
|
|
|
973
|
+
#### IsSyncingResult
|
|
974
|
+
|
|
975
|
+
| Prop | Type | Description | Since |
|
|
976
|
+
| ------------- | -------------------- | -------------------------------------------------- | ----- |
|
|
977
|
+
| **`syncing`** | <code>boolean</code> | Whether a sync operation is currently in progress. | 7.4.0 |
|
|
978
|
+
|
|
979
|
+
|
|
778
980
|
#### GetNextBundleResult
|
|
779
981
|
|
|
780
982
|
| Prop | Type | Description | Since |
|
|
@@ -812,6 +1014,13 @@ Remove all listeners for this plugin.
|
|
|
812
1014
|
| **`channel`** | <code>string \| null</code> | The channel name. Set `null` to remove the channel. | 5.0.0 |
|
|
813
1015
|
|
|
814
1016
|
|
|
1017
|
+
#### SetConfigOptions
|
|
1018
|
+
|
|
1019
|
+
| Prop | Type | Description | Since |
|
|
1020
|
+
| ----------- | --------------------------- | ----------------------------------------------------------------------------------------------------- | ----- |
|
|
1021
|
+
| **`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 |
|
|
1022
|
+
|
|
1023
|
+
|
|
815
1024
|
#### SetCustomIdOptions
|
|
816
1025
|
|
|
817
1026
|
| Prop | Type | Description | Since |
|
|
@@ -884,6 +1093,13 @@ Listener for when a bundle is set as the next bundle.
|
|
|
884
1093
|
|
|
885
1094
|
<code>(event: <a href="#nextbundlesetevent">NextBundleSetEvent</a>): void</code>
|
|
886
1095
|
|
|
1096
|
+
|
|
1097
|
+
#### ReloadedListener
|
|
1098
|
+
|
|
1099
|
+
Listener for when the app is reloaded.
|
|
1100
|
+
|
|
1101
|
+
<code>(): void</code>
|
|
1102
|
+
|
|
887
1103
|
</docgen-api>
|
|
888
1104
|
|
|
889
1105
|
## Testing
|