@capawesome/capacitor-live-update 6.7.2 → 7.1.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.
Files changed (43) hide show
  1. package/CapawesomeCapacitorLiveUpdate.podspec +2 -2
  2. package/Package.swift +32 -0
  3. package/README.md +102 -88
  4. package/android/build.gradle +9 -9
  5. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/LiveUpdate.java +192 -133
  6. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/LiveUpdateConfig.java +6 -27
  7. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/LiveUpdateHttpClient.java +7 -2
  8. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/LiveUpdatePlugin.java +51 -77
  9. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/LiveUpdatePreferences.java +12 -5
  10. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/api/GetLatestBundleResponse.java +27 -0
  11. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/events/DownloadBundleProgressEvent.java +32 -0
  12. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/options/DownloadBundleOptions.java +16 -1
  13. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/results/FetchLatestBundleResult.java +29 -1
  14. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/results/ReadyResult.java +32 -0
  15. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/interfaces/DownloadProgressCallback.java +5 -0
  16. package/dist/docs.json +228 -147
  17. package/dist/esm/definitions.d.ts +140 -49
  18. package/dist/esm/definitions.js.map +1 -1
  19. package/dist/esm/index.js +1 -1
  20. package/dist/esm/index.js.map +1 -1
  21. package/dist/esm/web.d.ts +2 -2
  22. package/dist/esm/web.js.map +1 -1
  23. package/dist/plugin.cjs.js +1 -3
  24. package/dist/plugin.cjs.js.map +1 -1
  25. package/dist/plugin.js +1 -3
  26. package/dist/plugin.js.map +1 -1
  27. package/ios/Plugin/Classes/Events/DownloadBundleProgressEvent.swift +25 -0
  28. package/ios/Plugin/Classes/Options/DownloadBundleOptions.swift +7 -1
  29. package/ios/Plugin/Classes/Results/{FetchLatestBundle.swift → FetchLatestBundleResult.swift} +16 -1
  30. package/ios/Plugin/Classes/Results/ReadyResult.swift +22 -0
  31. package/ios/Plugin/LiveUpdate.swift +171 -154
  32. package/ios/Plugin/LiveUpdateConfig.swift +2 -4
  33. package/ios/Plugin/LiveUpdateHttpClient.swift +6 -2
  34. package/ios/Plugin/LiveUpdatePlugin.swift +45 -37
  35. package/ios/Plugin/LiveUpdatePreferences.swift +6 -20
  36. package/ios/Plugin/Protocols/Api/GetLatestBundleResponse.swift +3 -0
  37. package/package.json +17 -18
  38. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/options/SetBundleOptions.java +0 -18
  39. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/results/GetBundleResult.java +0 -24
  40. package/ios/Plugin/Classes/Options/SetBundleOptions.swift +0 -14
  41. package/ios/Plugin/Classes/Results/GetBundleResult.swift +0 -16
  42. package/ios/Plugin/LiveUpdatePlugin.h +0 -10
  43. package/ios/Plugin/LiveUpdatePlugin.m +0 -27
@@ -11,10 +11,10 @@ Pod::Spec.new do |s|
11
11
  s.author = package['author']
12
12
  s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
13
13
  s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
14
- s.ios.deployment_target = '13.0'
14
+ s.ios.deployment_target = '14.0'
15
15
  s.dependency 'Capacitor'
16
16
  s.dependency 'Alamofire', '~> 5.9.0'
17
- s.dependency 'SSZipArchive', '~> 2.2'
17
+ s.dependency 'SSZipArchive', '~> 2.2.3'
18
18
  s.swift_version = '5.1'
19
19
  s.static_framework = true
20
20
  end
package/Package.swift ADDED
@@ -0,0 +1,32 @@
1
+ // swift-tools-version: 5.9
2
+ import PackageDescription
3
+
4
+ let package = Package(
5
+ name: "CapawesomeCapacitorLiveUpdate",
6
+ platforms: [.iOS(.v14)],
7
+ products: [
8
+ .library(
9
+ name: "CapawesomeCapacitorLiveUpdate",
10
+ targets: ["LiveUpdatePlugin"])
11
+ ],
12
+ dependencies: [
13
+ .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "7.0.0"),
14
+ .package(url: "https://github.com/Alamofire/Alamofire.git", .upToNextMajor(from: "5.9.0")),
15
+ .package(url: "https://github.com/ZipArchive/ZipArchive.git", .upToNextMinor(from: "2.4.0"))
16
+ ],
17
+ targets: [
18
+ .target(
19
+ name: "LiveUpdatePlugin",
20
+ dependencies: [
21
+ .product(name: "Capacitor", package: "capacitor-swift-pm"),
22
+ .product(name: "Cordova", package: "capacitor-swift-pm"),
23
+ .product(name: "Alamofire", package: "Alamofire"),
24
+ .product(name: "ZipArchive", package: "ZipArchive")
25
+ ],
26
+ path: "ios/Plugin"),
27
+ .testTarget(
28
+ name: "LiveUpdatePluginTests",
29
+ dependencies: ["LiveUpdatePlugin"],
30
+ path: "ios/PluginTests")
31
+ ]
32
+ )
package/README.md CHANGED
@@ -5,9 +5,9 @@ Capacitor plugin to update your app remotely in real-time.
5
5
  ## Features
6
6
 
7
7
  - 🔋 Supports **Android and iOS**
8
- - ⚡️ **Capacitor 6** support
8
+ - ⚡️ **Capacitor 7** support
9
9
  - 📦 **Bundle Management**: Download, set, and delete bundles.
10
- - ☁️ **Cloud Support**: Use the [Capawesome Cloud](https://capawesome.io/cloud/live-updates/) to manage your app updates.
10
+ - ☁️ **Cloud Support**: Use the [Capawesome Cloud](https://cloud.capawesome.io/) to manage your app updates.
11
11
  - 📺 **Channel Support**: Set a channel for the app to manage different versions.
12
12
  - 🔄 **Auto Update**: Automatically download and set the latest bundle for the app.
13
13
  - 🛟 **Rollback**: Reset the app to the default bundle if an incompatible bundle has been set.
@@ -66,17 +66,15 @@ We recommend to declare [`CA92.1`](https://developer.apple.com/documentation/bun
66
66
  <docgen-config>
67
67
  <!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
68
68
 
69
- | Prop | Type | Description | Default | Since |
70
- | ----------------------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------ | ----- |
71
- | **`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 |
72
- | **`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 |
73
- | **`defaultChannel`** | <code>string</code> | The default channel of the app. | | 6.3.0 |
74
- | **`enabled`** | <code>boolean</code> | Whether or not the plugin is enabled. | <code>true</code> | 5.0.0 |
75
- | **`httpTimeout`** | <code>number</code> | The timeout in milliseconds for HTTP requests. | <code>60000</code> | 6.4.0 |
76
- | **`location`** | <code>'us' \| 'eu'</code> | The location of the server to use when using [Capawesome Cloud](https://capawesome.io/cloud). | <code>'us'</code> | 6.2.0 |
77
- | **`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 |
78
- | **`readyTimeout`** | <code>number</code> | The timeout in milliseconds to wait for the app to be ready before resetting to the default bundle. | <code>10000</code> | 5.0.0 |
79
- | **`resetOnUpdate`** | <code>boolean</code> | Whether or not the app should be reset to the default bundle during an update. | <code>true</code> | 5.0.0 |
69
+ | Prop | Type | Description | Default | Since |
70
+ | ----------------------- | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- | ----- |
71
+ | **`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 |
72
+ | **`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 |
73
+ | **`defaultChannel`** | <code>string</code> | The default channel of the app. | | 6.3.0 |
74
+ | **`httpTimeout`** | <code>number</code> | The timeout in milliseconds for HTTP requests. | <code>60000</code> | 6.4.0 |
75
+ | **`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 |
76
+ | **`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 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 |
77
+ | **`serverDomain`** | <code>string</code> | The API domain of the [Capawesome Cloud](https://cloud.capawesome.io) server. | <code>'api.cloud.capawesome.io'</code> | 7.0.0 |
80
78
 
81
79
  ### Examples
82
80
 
@@ -89,12 +87,10 @@ In `capacitor.config.json`:
89
87
  "appId": '6e351b4f-69a7-415e-a057-4567df7ffe94',
90
88
  "autoDeleteBundles": undefined,
91
89
  "defaultChannel": 'production',
92
- "enabled": undefined,
93
90
  "httpTimeout": undefined,
94
- "location": 'eu',
95
91
  "publicKey": '-----BEGIN PUBLIC KEY-----MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDodf1SD0OOn6hIlDuKBza0Ed0OqtwyVJwiyjmE9BJaZ7y8ZUfcF+SKmd0l2cDPM45XIg2tAFux5n29uoKyHwSt+6tCi5CJA5Z1/1eZruRRqABLonV77KS3HUtvOgqRLDnKSV89dYZkM++NwmzOPgIF422mvc+VukcVOBfc8/AHQIDAQAB-----END PUBLIC KEY-----',
96
- "readyTimeout": undefined,
97
- "resetOnUpdate": undefined
92
+ "readyTimeout": 10000,
93
+ "serverDomain": undefined
98
94
  }
99
95
  }
100
96
  }
@@ -113,12 +109,10 @@ const config: CapacitorConfig = {
113
109
  appId: '6e351b4f-69a7-415e-a057-4567df7ffe94',
114
110
  autoDeleteBundles: undefined,
115
111
  defaultChannel: 'production',
116
- enabled: undefined,
117
112
  httpTimeout: undefined,
118
- location: 'eu',
119
113
  publicKey: '-----BEGIN PUBLIC KEY-----MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDodf1SD0OOn6hIlDuKBza0Ed0OqtwyVJwiyjmE9BJaZ7y8ZUfcF+SKmd0l2cDPM45XIg2tAFux5n29uoKyHwSt+6tCi5CJA5Z1/1eZruRRqABLonV77KS3HUtvOgqRLDnKSV89dYZkM++NwmzOPgIF422mvc+VukcVOBfc8/AHQIDAQAB-----END PUBLIC KEY-----',
120
- readyTimeout: undefined,
121
- resetOnUpdate: undefined,
114
+ readyTimeout: 10000,
115
+ serverDomain: undefined,
122
116
  },
123
117
  },
124
118
  };
@@ -228,7 +222,7 @@ const sync = async () => {
228
222
  const isNewBundleAvailable = async () => {
229
223
  const { bundleId: latestBundleId } = await LiveUpdate.fetchLatestBundle();
230
224
  if (latestBundleId) {
231
- const { bundleId: currentBundleId } = await LiveUpdate.getBundle();
225
+ const { bundleId: currentBundleId } = await LiveUpdate.getCurrentBundle();
232
226
  return latestBundleId !== currentBundleId;
233
227
  } else {
234
228
  return false;
@@ -243,7 +237,6 @@ const isNewBundleAvailable = async () => {
243
237
  * [`deleteBundle(...)`](#deletebundle)
244
238
  * [`downloadBundle(...)`](#downloadbundle)
245
239
  * [`fetchLatestBundle(...)`](#fetchlatestbundle)
246
- * [`getBundle()`](#getbundle)
247
240
  * [`getBundles()`](#getbundles)
248
241
  * [`getChannel()`](#getchannel)
249
242
  * [`getCurrentBundle()`](#getcurrentbundle)
@@ -255,12 +248,13 @@ const isNewBundleAvailable = async () => {
255
248
  * [`ready()`](#ready)
256
249
  * [`reload()`](#reload)
257
250
  * [`reset()`](#reset)
258
- * [`setBundle(...)`](#setbundle)
259
251
  * [`setChannel(...)`](#setchannel)
260
252
  * [`setCustomId(...)`](#setcustomid)
261
253
  * [`setNextBundle(...)`](#setnextbundle)
262
254
  * [`sync(...)`](#sync)
255
+ * [`addListener('downloadBundleProgress', ...)`](#addlistenerdownloadbundleprogress-)
263
256
  * [Interfaces](#interfaces)
257
+ * [Type Aliases](#type-aliases)
264
258
 
265
259
  </docgen-index>
266
260
 
@@ -326,23 +320,6 @@ Only available on Android and iOS.
326
320
  --------------------
327
321
 
328
322
 
329
- ### getBundle()
330
-
331
- ```typescript
332
- getBundle() => Promise<GetBundleResult>
333
- ```
334
-
335
- Get the active bundle identifier.
336
-
337
- Only available on Android and iOS.
338
-
339
- **Returns:** <code>Promise&lt;<a href="#getbundleresult">GetBundleResult</a>&gt;</code>
340
-
341
- **Since:** 5.0.0
342
-
343
- --------------------
344
-
345
-
346
323
  ### getBundles()
347
324
 
348
325
  ```typescript
@@ -456,6 +433,9 @@ getVersionCode() => Promise<GetVersionCodeResult>
456
433
 
457
434
  Get the version code of the app.
458
435
 
436
+ On **Android**, this is the `versionCode` from the `android/app/build.gradle` file.
437
+ On **iOS**, this is the `CFBundleVersion` from the `Info.plist` file.
438
+
459
439
  Only available on Android and iOS.
460
440
 
461
441
  **Returns:** <code>Promise&lt;<a href="#getversioncoderesult">GetVersionCodeResult</a>&gt;</code>
@@ -473,6 +453,9 @@ getVersionName() => Promise<GetVersionNameResult>
473
453
 
474
454
  Get the version name of the app.
475
455
 
456
+ On **Android**, this is the `versionName` from the `android/app/build.gradle` file.
457
+ On **iOS**, this is the `CFBundleShortVersionString` from the `Info.plist` file.
458
+
476
459
  Only available on Android and iOS.
477
460
 
478
461
  **Returns:** <code>Promise&lt;<a href="#getversionnameresult">GetVersionNameResult</a>&gt;</code>
@@ -485,7 +468,7 @@ Only available on Android and iOS.
485
468
  ### ready()
486
469
 
487
470
  ```typescript
488
- ready() => Promise<void>
471
+ ready() => Promise<ReadyResult>
489
472
  ```
490
473
 
491
474
  Notify the plugin that the app is ready to use and no rollback is needed.
@@ -495,6 +478,8 @@ to prevent the app from being reset to the default bundle.
495
478
 
496
479
  Only available on Android and iOS.
497
480
 
481
+ **Returns:** <code>Promise&lt;<a href="#readyresult">ReadyResult</a>&gt;</code>
482
+
498
483
  **Since:** 5.0.0
499
484
 
500
485
  --------------------
@@ -532,27 +517,6 @@ Only available on Android and iOS.
532
517
  --------------------
533
518
 
534
519
 
535
- ### setBundle(...)
536
-
537
- ```typescript
538
- setBundle(options: SetBundleOptions) => Promise<void>
539
- ```
540
-
541
- Set the next bundle to use for the app.
542
-
543
- Call `reload()` or restart the app to apply the changes.
544
-
545
- Only available on Android and iOS.
546
-
547
- | Param | Type |
548
- | ------------- | ------------------------------------------------------------- |
549
- | **`options`** | <code><a href="#setbundleoptions">SetBundleOptions</a></code> |
550
-
551
- **Since:** 5.0.0
552
-
553
- --------------------
554
-
555
-
556
520
  ### setChannel(...)
557
521
 
558
522
  ```typescript
@@ -635,6 +599,28 @@ Only available on Android and iOS.
635
599
  --------------------
636
600
 
637
601
 
602
+ ### addListener('downloadBundleProgress', ...)
603
+
604
+ ```typescript
605
+ addListener(eventName: 'downloadBundleProgress', listenerFunc: DownloadBundleProgressListener) => Promise<PluginListenerHandle>
606
+ ```
607
+
608
+ Listen for the download progress of a bundle.
609
+
610
+ Only available on Android and iOS.
611
+
612
+ | Param | Type |
613
+ | ------------------ | ----------------------------------------------------------------------------------------- |
614
+ | **`eventName`** | <code>'downloadBundleProgress'</code> |
615
+ | **`listenerFunc`** | <code><a href="#downloadbundleprogresslistener">DownloadBundleProgressListener</a></code> |
616
+
617
+ **Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>
618
+
619
+ **Since:** 7.0.0
620
+
621
+ --------------------
622
+
623
+
638
624
  ### Interfaces
639
625
 
640
626
 
@@ -647,21 +633,25 @@ Only available on Android and iOS.
647
633
 
648
634
  #### DownloadBundleOptions
649
635
 
650
- | Prop | Type | Description | Default | Since |
651
- | ------------------ | -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | ----- |
652
- | **`artifactType`** | <code>'manifest' \| 'zip'</code> | The artifact type of the bundle. | <code>'zip'</code> | 6.6.0 |
653
- | **`bundleId`** | <code>string</code> | The unique identifier of the bundle. | | 5.0.0 |
654
- | **`checksum`** | <code>string</code> | The checksum of the bundle to verify the integrity of the ZIP file. Must be a SHA-256 hash in base64 format. | | 6.1.0 |
655
- | **`url`** | <code>string</code> | The URL of the bundle to download. For the `zip` artifact type, the URL must point to a ZIP file. For the `manifest` artifact type, the URL serves as the base URL to download the individual files. For example, if the URL is `https://example.com/download`, the plugin will download the file with the href `index.html` from `https://example.com/download?href=index.html`. To **verify the integrity** of the file, the server must return a `X-Checksum` header with the SHA-256 hash in base64 format. To **verify the signature** of the file, the server must return a `X-Signature` header with the signed SHA-256 hash in base64 format. | | 5.0.0 |
636
+ | Prop | Type | Description | Default | Since |
637
+ | ------------------ | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | ----- |
638
+ | **`artifactType`** | <code>'manifest' \| 'zip'</code> | The artifact type of the bundle. | <code>'zip'</code> | 6.6.0 |
639
+ | **`bundleId`** | <code>string</code> | The unique identifier of the bundle. **Attention**: The value `public` is reserved and cannot be used as a bundle identifier. | | 5.0.0 |
640
+ | **`checksum`** | <code>string</code> | The checksum of the self-hosted bundle as a SHA-256 hash in base64 format to verify the integrity of the bundle. **Attention**: Only supported for the `zip` artifact type. | | 7.1.0 |
641
+ | **`signature`** | <code>string</code> | The signature of the self-hosted bundle as a signed SHA-256 hash in base64 format to verify the integrity of the bundle. **Attention**: Only supported for the `zip` artifact type. | | 7.1.0 |
642
+ | **`url`** | <code>string</code> | The URL of the bundle to download. For the `zip` artifact type, the URL must point to a ZIP file. For the `manifest` artifact type, the URL serves as the base URL to download the individual files. For example, if the URL is `https://example.com/download`, the plugin will download the file with the href `index.html` from `https://example.com/download?href=index.html`. To **verify the integrity** of the file, the server should return a `X-Checksum` header with the SHA-256 hash in base64 format. To **verify the signature** of the file, the server should return a `X-Signature` header with the signed SHA-256 hash in base64 format. | | 5.0.0 |
656
643
 
657
644
 
658
645
  #### FetchLatestBundleResult
659
646
 
660
- | Prop | Type | Description | Since |
661
- | ------------------ | -------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ----- |
662
- | **`artifactType`** | <code>'manifest' \| 'zip'</code> | The artifact type of the bundle. | 6.7.0 |
663
- | **`bundleId`** | <code>string \| null</code> | The unique identifier of the latest bundle. If `null`, no bundle is available. | 6.6.0 |
664
- | **`downloadUrl`** | <code>string</code> | The URL of the latest bundle to download. Pass this URL to the `downloadBundle(...)` method to download the bundle. | 6.7.0 |
647
+ | Prop | Type | Description | Since |
648
+ | ---------------------- | --------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
649
+ | **`artifactType`** | <code>'manifest' \| 'zip'</code> | The artifact type of the bundle. | 6.7.0 |
650
+ | **`bundleId`** | <code>string \| null</code> | The unique identifier of the latest bundle. If `null`, no bundle is available. | 6.6.0 |
651
+ | **`checksum`** | <code>string</code> | The checksum of the latest bundle if the bundle is self-hosted. If the bundle is hosted on Capawesome Cloud, the checksum will be returned as response header when downloading the bundle. | 7.1.0 |
652
+ | **`customProperties`** | <code>{ [key: string]: string; }</code> | Custom properties that are associated with the latest bundle. | 7.0.0 |
653
+ | **`downloadUrl`** | <code>string</code> | The URL of the latest bundle to download. Pass this URL to the `downloadBundle(...)` method to download the bundle. | 6.7.0 |
654
+ | **`signature`** | <code>string</code> | The signature of the latest bundle if the bundle is self-hosted. If the bundle is hosted on Capawesome Cloud, the signature will be returned as response header when downloading the bundle. | 7.1.0 |
665
655
 
666
656
 
667
657
  #### FetchLatestBundleOptions
@@ -671,13 +661,6 @@ Only available on Android and iOS.
671
661
  | **`channel`** | <code>string</code> | The name of the channel where the latest bundle is fetched from. | 6.7.0 |
672
662
 
673
663
 
674
- #### GetBundleResult
675
-
676
- | Prop | Type | Description | Since |
677
- | -------------- | --------------------------- | ---------------------------------------------------------------------------------------- | ----- |
678
- | **`bundleId`** | <code>string \| null</code> | The unique identifier of the active bundle. If `null`, the default bundle is being used. | 5.0.0 |
679
-
680
-
681
664
  #### GetBundlesResult
682
665
 
683
666
  | Prop | Type | Description | Since |
@@ -734,11 +717,13 @@ Only available on Android and iOS.
734
717
  | **`versionName`** | <code>string</code> | The version name of the app. On **Android**, this is the `versionName` from the `android/app/build.gradle` file. On **iOS**, this is the `CFBundleShortVersionString` from the `Info.plist` file. | 5.0.0 |
735
718
 
736
719
 
737
- #### SetBundleOptions
720
+ #### ReadyResult
738
721
 
739
- | Prop | Type | Description | Since |
740
- | -------------- | ------------------- | ------------------------------------------- | ----- |
741
- | **`bundleId`** | <code>string</code> | The unique identifier of the bundle to use. | 5.0.0 |
722
+ | Prop | Type | Description | Since |
723
+ | ---------------------- | --------------------------- | --------------------------------------------------------------------------------------- | ----- |
724
+ | **`previousBundleId`** | <code>string \| null</code> | The identifier of the previous bundle used. If `null`, the default bundle was used. | 7.0.0 |
725
+ | **`currentBundleId`** | <code>string \| null</code> | The identifier of the current bundle used. If `null`, the default bundle is being used. | 7.0.0 |
726
+ | **`rollback`** | <code>boolean</code> | Whether or not the app was reset to the default bundle. | 7.0.0 |
742
727
 
743
728
 
744
729
  #### SetChannelOptions
@@ -775,6 +760,35 @@ Only available on Android and iOS.
775
760
  | ------------- | ------------------- | ---------------------------------------------------------------- | ----- |
776
761
  | **`channel`** | <code>string</code> | The name of the channel where the latest bundle is fetched from. | 6.7.0 |
777
762
 
763
+
764
+ #### PluginListenerHandle
765
+
766
+ | Prop | Type |
767
+ | ------------ | ----------------------------------------- |
768
+ | **`remove`** | <code>() =&gt; Promise&lt;void&gt;</code> |
769
+
770
+
771
+ #### DownloadBundleProgressEvent
772
+
773
+ Event that is triggered when the download progress of a bundle changes.
774
+
775
+ | Prop | Type | Description | Since |
776
+ | --------------------- | ------------------- | ----------------------------------------------------------------------- | ----- |
777
+ | **`bundleId`** | <code>string</code> | The unique identifier of the bundle that is being downloaded. | 7.0.0 |
778
+ | **`downloadedBytes`** | <code>number</code> | The number of bytes that have been downloaded. | 7.0.0 |
779
+ | **`progress`** | <code>number</code> | The progress of the download in percent as a value between `0` and `1`. | 7.0.0 |
780
+ | **`totalBytes`** | <code>number</code> | The total number of bytes to download. | 7.0.0 |
781
+
782
+
783
+ ### Type Aliases
784
+
785
+
786
+ #### DownloadBundleProgressListener
787
+
788
+ Listener for the download progress of a bundle.
789
+
790
+ <code>(event: <a href="#downloadbundleprogressevent">DownloadBundleProgressEvent</a>): void</code>
791
+
778
792
  </docgen-api>
779
793
 
780
794
  ## Testing
@@ -804,10 +818,10 @@ So if you make local changes to your app and execute `npx cap run`, for example,
804
818
  You then have three options to get back to the default bundle:
805
819
 
806
820
  1. **Reset**: Call the [`reset()`](#reset) method to reset the app to the default bundle.
807
- 2. **Reinstall**: Reinstall the app to use the default bundle.
808
- 3. **Update**: Increase the `versionCode`/`CFBundleVersion` so that the plugin automatically performs a reset (assuming the [`resetOnUpdate`](#configuration) configuration option is active).
821
+ 2. **Reinstall**: Reinstall the app to remove the live update bundle.
822
+ 3. **Update**: Increase the native version code of your app so that Capacitor automatically resets to the default bundle.
809
823
 
810
- However, this is only a problem during development. It is not a problem in production as long as you have the [`resetOnUpdate`](#configuration) configuration option enabled, as the `versionCode`/`CFBundleVersion` is always incremented during a native update and thus always resets to the default bundle.
824
+ However, this is only a problem during development. It is not a problem in production, as Capacitor automatically resets to the default bundle after a native update.
811
825
 
812
826
  ## Changelog
813
827
 
@@ -1,8 +1,8 @@
1
1
  ext {
2
2
  junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
3
- androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1'
4
- androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5'
5
- androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1'
3
+ androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0'
4
+ androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1'
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
8
  }
@@ -13,7 +13,7 @@ buildscript {
13
13
  mavenCentral()
14
14
  }
15
15
  dependencies {
16
- classpath 'com.android.tools.build:gradle:8.2.1'
16
+ classpath 'com.android.tools.build:gradle:8.7.2'
17
17
  }
18
18
  }
19
19
 
@@ -21,10 +21,10 @@ apply plugin: 'com.android.library'
21
21
 
22
22
  android {
23
23
  namespace "io.capawesome.capacitorjs.plugins.liveupdate"
24
- compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34
24
+ compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35
25
25
  defaultConfig {
26
- minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
27
- targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34
26
+ minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23
27
+ targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35
28
28
  versionCode 1
29
29
  versionName "1.0"
30
30
  testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -39,8 +39,8 @@ android {
39
39
  abortOnError false
40
40
  }
41
41
  compileOptions {
42
- sourceCompatibility JavaVersion.VERSION_17
43
- targetCompatibility JavaVersion.VERSION_17
42
+ sourceCompatibility JavaVersion.VERSION_21
43
+ targetCompatibility JavaVersion.VERSION_21
44
44
  }
45
45
  }
46
46