@capgo/capacitor-updater 4.34.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.34.0";
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.34.0"
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
- return self.autoUpdate && self.updateUrl != ""
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-updater",
3
- "version": "4.34.0",
3
+ "version": "4.36.0",
4
4
  "packageManager": "pnpm@8.1.0",
5
5
  "license": "MPL-2.0",
6
6
  "description": "Live update for capacitor apps",
@@ -53,18 +53,18 @@
53
53
  "prepublishOnly": "npm run build"
54
54
  },
55
55
  "devDependencies": {
56
- "@capacitor/android": "^4.7.1",
57
- "@capacitor/cli": "^4.7.1",
58
- "@capacitor/core": "^4.7.1",
56
+ "@capacitor/android": "^4.7.3",
57
+ "@capacitor/cli": "^4.7.3",
58
+ "@capacitor/core": "^4.7.3",
59
59
  "@capacitor/docgen": "^0.2.1",
60
- "@capacitor/ios": "^4.7.1",
60
+ "@capacitor/ios": "^4.7.3",
61
61
  "@ionic/eslint-config": "^0.3.0",
62
62
  "@ionic/prettier-config": "^2.0.0",
63
63
  "@ionic/swiftlint-config": "^1.1.2",
64
- "@types/node": "^18.15.7",
65
- "@typescript-eslint/eslint-plugin": "^5.56.0",
66
- "@typescript-eslint/parser": "^5.56.0",
67
- "eslint": "^8.36.0",
64
+ "@types/node": "^18.15.11",
65
+ "@typescript-eslint/eslint-plugin": "^5.58.0",
66
+ "@typescript-eslint/parser": "^5.58.0",
67
+ "eslint": "^8.38.0",
68
68
  "eslint-plugin-import": "^2.27.5",
69
69
  "prettier": "^2.8.7",
70
70
  "prettier-plugin-java": "^2.1.0",