@capgo/capacitor-updater 4.35.0 → 4.36.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.
|
@@ -55,7 +55,7 @@ public class CapacitorUpdaterPlugin
|
|
|
55
55
|
private static final String channelUrlDefault =
|
|
56
56
|
"https://api.capgo.app/channel_self";
|
|
57
57
|
|
|
58
|
-
private final String PLUGIN_VERSION = "4.
|
|
58
|
+
private final String PLUGIN_VERSION = "4.36.0";
|
|
59
59
|
private static final String DELAY_CONDITION_PREFERENCES = "";
|
|
60
60
|
|
|
61
61
|
private SharedPreferences.Editor editor;
|
|
@@ -782,9 +782,20 @@ public class CapacitorUpdaterPlugin
|
|
|
782
782
|
}
|
|
783
783
|
|
|
784
784
|
private Boolean _isAutoUpdateEnabled() {
|
|
785
|
+
final CapConfig config = CapConfig.loadDefault(this.getActivity());
|
|
786
|
+
String serverUrl = config.getServerUrl();
|
|
787
|
+
if (serverUrl != null && !"".equals(serverUrl)) {
|
|
788
|
+
// log warning autoupdate disabled when serverUrl is set
|
|
789
|
+
Log.w(
|
|
790
|
+
CapacitorUpdater.TAG,
|
|
791
|
+
"AutoUpdate is automatic disabled when serverUrl is set."
|
|
792
|
+
);
|
|
793
|
+
}
|
|
785
794
|
return (
|
|
786
795
|
CapacitorUpdaterPlugin.this.autoUpdate &&
|
|
787
|
-
!"".equals(CapacitorUpdaterPlugin.this.updateUrl)
|
|
796
|
+
!"".equals(CapacitorUpdaterPlugin.this.updateUrl) &&
|
|
797
|
+
serverUrl != null &&
|
|
798
|
+
!"".equals(serverUrl)
|
|
788
799
|
);
|
|
789
800
|
}
|
|
790
801
|
|
|
@@ -15,7 +15,7 @@ import Version
|
|
|
15
15
|
@objc(CapacitorUpdaterPlugin)
|
|
16
16
|
public class CapacitorUpdaterPlugin: CAPPlugin {
|
|
17
17
|
private var implementation = CapacitorUpdater()
|
|
18
|
-
private let PLUGIN_VERSION: String = "4.
|
|
18
|
+
private let PLUGIN_VERSION: String = "4.36.0"
|
|
19
19
|
static let updateUrlDefault = "https://api.capgo.app/updates"
|
|
20
20
|
static let statsUrlDefault = "https://api.capgo.app/stats"
|
|
21
21
|
static let channelUrlDefault = "https://api.capgo.app/channel_self"
|
|
@@ -434,7 +434,11 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
|
|
|
434
434
|
}
|
|
435
435
|
|
|
436
436
|
private func _isAutoUpdateEnabled() -> Bool {
|
|
437
|
-
|
|
437
|
+
let instanceDescriptor = (self.bridge?.viewController as? CAPBridgeViewController)?.instanceDescriptor()
|
|
438
|
+
if instanceDescriptor?.serverURL != nil {
|
|
439
|
+
print("⚠️ \(self.implementation.TAG) AutoUpdate is automatic disabled when serverUrl is set.")
|
|
440
|
+
}
|
|
441
|
+
return self.autoUpdate && self.updateUrl != "" && instanceDescriptor?.serverURL == nil
|
|
438
442
|
}
|
|
439
443
|
|
|
440
444
|
@objc func isAutoUpdateEnabled(_ call: CAPPluginCall) {
|
|
@@ -632,6 +636,8 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
|
|
|
632
636
|
}
|
|
633
637
|
if self._isAutoUpdateEnabled() {
|
|
634
638
|
self.backgroundDownload()
|
|
639
|
+
} else {
|
|
640
|
+
print("\(self.implementation.TAG) Auto update is disabled")
|
|
635
641
|
}
|
|
636
642
|
self.checkAppReady()
|
|
637
643
|
}
|