@capgo/capacitor-updater 8.42.5 → 8.42.6
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/Package.swift +1 -1
- package/android/src/main/java/ee/forgr/capacitor_updater/CapacitorUpdaterPlugin.java +1 -1
- package/android/src/main/java/ee/forgr/capacitor_updater/CapgoUpdater.java +7 -0
- package/ios/Sources/CapacitorUpdaterPlugin/CapacitorUpdaterPlugin.swift +1 -1
- package/ios/Sources/CapacitorUpdaterPlugin/CapgoUpdater.swift +9 -0
- package/ios/Sources/CapacitorUpdaterPlugin/InternalUtils.swift +1 -0
- package/package.json +1 -1
package/Package.swift
CHANGED
|
@@ -10,7 +10,7 @@ let package = Package(
|
|
|
10
10
|
targets: ["CapacitorUpdaterPlugin"])
|
|
11
11
|
],
|
|
12
12
|
dependencies: [
|
|
13
|
-
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "8.0.
|
|
13
|
+
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "8.0.0"),
|
|
14
14
|
.package(url: "https://github.com/Alamofire/Alamofire.git", .upToNextMajor(from: "5.11.0")),
|
|
15
15
|
.package(url: "https://github.com/weichsel/ZIPFoundation.git", from: "0.9.20"),
|
|
16
16
|
.package(url: "https://github.com/mrackwitz/Version.git", exact: "0.8.0"),
|
|
@@ -84,7 +84,7 @@ public class CapacitorUpdaterPlugin extends Plugin {
|
|
|
84
84
|
private static final String[] BREAKING_EVENT_NAMES = { "breakingAvailable", "majorAvailable" };
|
|
85
85
|
private static final String LAST_FAILED_BUNDLE_PREF_KEY = "CapacitorUpdater.lastFailedBundle";
|
|
86
86
|
|
|
87
|
-
private final String pluginVersion = "8.42.
|
|
87
|
+
private final String pluginVersion = "8.42.6";
|
|
88
88
|
private static final String DELAY_CONDITION_PREFERENCES = "";
|
|
89
89
|
|
|
90
90
|
private SharedPreferences.Editor editor;
|
|
@@ -1243,6 +1243,13 @@ public class CapgoUpdater {
|
|
|
1243
1243
|
makeJsonRequest(channelUrl, json, (res) -> {
|
|
1244
1244
|
if (res.containsKey("error")) {
|
|
1245
1245
|
callback.callback(res);
|
|
1246
|
+
} else if (Boolean.TRUE.equals(res.get("unset"))) {
|
|
1247
|
+
// Server requested to unset channel (public channel was requested)
|
|
1248
|
+
// Clear persisted defaultChannel and revert to config value
|
|
1249
|
+
editor.remove(defaultChannelKey);
|
|
1250
|
+
editor.apply();
|
|
1251
|
+
logger.info("Public channel requested, channel override removed");
|
|
1252
|
+
callback.callback(res);
|
|
1246
1253
|
} else {
|
|
1247
1254
|
// Success - persist defaultChannel
|
|
1248
1255
|
this.defaultChannel = channel;
|
|
@@ -71,7 +71,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
71
71
|
CAPPluginMethod(name: "completeFlexibleUpdate", returnType: CAPPluginReturnPromise)
|
|
72
72
|
]
|
|
73
73
|
public var implementation = CapgoUpdater()
|
|
74
|
-
private let pluginVersion: String = "8.42.
|
|
74
|
+
private let pluginVersion: String = "8.42.6"
|
|
75
75
|
static let updateUrlDefault = "https://plugin.capgo.app/updates"
|
|
76
76
|
static let statsUrlDefault = "https://plugin.capgo.app/stats"
|
|
77
77
|
static let channelUrlDefault = "https://plugin.capgo.app/channel_self"
|
|
@@ -1549,6 +1549,15 @@ import UIKit
|
|
|
1549
1549
|
if let responseValue = response.value {
|
|
1550
1550
|
if let error = responseValue.error {
|
|
1551
1551
|
setChannel.error = error
|
|
1552
|
+
} else if responseValue.unset == true {
|
|
1553
|
+
// Server requested to unset channel (public channel was requested)
|
|
1554
|
+
// Clear persisted defaultChannel and revert to config value
|
|
1555
|
+
UserDefaults.standard.removeObject(forKey: defaultChannelKey)
|
|
1556
|
+
UserDefaults.standard.synchronize()
|
|
1557
|
+
self.logger.info("Public channel requested, channel override removed")
|
|
1558
|
+
|
|
1559
|
+
setChannel.status = responseValue.status ?? "ok"
|
|
1560
|
+
setChannel.message = responseValue.message ?? "Public channel requested, channel override removed. Device will use public channel automatically."
|
|
1552
1561
|
} else {
|
|
1553
1562
|
// Success - persist defaultChannel
|
|
1554
1563
|
self.defaultChannel = channel
|