@capawesome/capacitor-live-update 6.0.6 → 6.0.7
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
CHANGED
|
@@ -11,6 +11,7 @@ Capacitor plugin to update your app remotely in real-time.
|
|
|
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.
|
|
14
|
+
- 🚀 **Rollout**: Gradually roll out new bundles to gather valuable feedback.
|
|
14
15
|
|
|
15
16
|
## Installation
|
|
16
17
|
|
|
@@ -116,6 +117,13 @@ export default config;
|
|
|
116
117
|
|
|
117
118
|
A working example can be found here: [robingenz/capacitor-plugin-demo](https://github.com/robingenz/capacitor-plugin-demo)
|
|
118
119
|
|
|
120
|
+
## Starter templates
|
|
121
|
+
|
|
122
|
+
The following starter templates are available:
|
|
123
|
+
|
|
124
|
+
- [Ionstarter Angular Firebase](https://ionstarter.dev/)
|
|
125
|
+
- [Ionstarter Angular SQLite](https://ionstarter.dev/)
|
|
126
|
+
|
|
119
127
|
## Guides
|
|
120
128
|
|
|
121
129
|
- [Announcing the Capacitor Live Update Plugin](https://capawesome.io/blog/announcing-the-capacitor-live-update-plugin/)
|
package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/LiveUpdatePlugin.java
CHANGED
|
@@ -19,7 +19,7 @@ import io.capawesome.capacitorjs.plugins.liveupdate.interfaces.Result;
|
|
|
19
19
|
public class LiveUpdatePlugin extends Plugin {
|
|
20
20
|
|
|
21
21
|
public static final String TAG = "LiveUpdate";
|
|
22
|
-
public static final String VERSION = "6.0.
|
|
22
|
+
public static final String VERSION = "6.0.7";
|
|
23
23
|
public static final String SHARED_PREFERENCES_NAME = "CapawesomeLiveUpdate"; // DO NOT CHANGE
|
|
24
24
|
public static final String ERROR_APP_ID_MISSING = "appId must be configured.";
|
|
25
25
|
public static final String ERROR_BUNDLE_EXISTS = "bundle already exists.";
|
|
@@ -21,7 +21,6 @@ import Alamofire
|
|
|
21
21
|
self.plugin = plugin
|
|
22
22
|
self.preferences = LiveUpdatePreferences()
|
|
23
23
|
super.init()
|
|
24
|
-
createBundlesDirectory()
|
|
25
24
|
|
|
26
25
|
if config.enabled {
|
|
27
26
|
if wasUpdated() && config.resetOnUpdate {
|
|
@@ -219,6 +218,10 @@ import Alamofire
|
|
|
219
218
|
completion(CustomError.bundleIndexHtmlMissing)
|
|
220
219
|
return
|
|
221
220
|
}
|
|
221
|
+
|
|
222
|
+
// Create the bundles directory if it does not exist
|
|
223
|
+
self.createBundlesDirectory()
|
|
224
|
+
|
|
222
225
|
// Move the unzipped files to the bundles directory
|
|
223
226
|
let bundlePath = self.buildBundlePathFor(bundleId: bundleId)
|
|
224
227
|
do {
|
|
@@ -399,7 +402,7 @@ import Alamofire
|
|
|
399
402
|
}
|
|
400
403
|
|
|
401
404
|
private func getNextCapacitorServerPath() -> String? {
|
|
402
|
-
if let path =
|
|
405
|
+
if let path = KeyValueStore.standard[self.defaultServerPathKey, as: String.self] {
|
|
403
406
|
return path.isEmpty ? nil : path
|
|
404
407
|
}
|
|
405
408
|
return nil
|
|
@@ -457,12 +460,11 @@ import Alamofire
|
|
|
457
460
|
private func setNextCapacitorServerPath(path: String) {
|
|
458
461
|
if path.hasSuffix("/public") {
|
|
459
462
|
// Reset the custom server base path
|
|
460
|
-
|
|
463
|
+
KeyValueStore.standard[self.defaultServerPathKey] = ""
|
|
461
464
|
} else {
|
|
462
465
|
// Attention: Only the lastPathComponent is used (see https://dub.sh/BLluidt)
|
|
463
|
-
|
|
466
|
+
KeyValueStore.standard[self.defaultServerPathKey] = path
|
|
464
467
|
}
|
|
465
|
-
UserDefaults.standard.synchronize()
|
|
466
468
|
}
|
|
467
469
|
|
|
468
470
|
private func setNextCapacitorServerPathToDefaultWebAssetDir() {
|
|
@@ -8,7 +8,7 @@ import Capacitor
|
|
|
8
8
|
@objc(LiveUpdatePlugin)
|
|
9
9
|
public class LiveUpdatePlugin: CAPPlugin {
|
|
10
10
|
public static let tag = "LiveUpdate"
|
|
11
|
-
public static let version = "6.0.
|
|
11
|
+
public static let version = "6.0.7"
|
|
12
12
|
public static let userDefaultsPrefix = "CapawesomeLiveUpdate" // DO NOT CHANGE
|
|
13
13
|
|
|
14
14
|
private var config: LiveUpdateConfig?
|