@capgo/capacitor-updater 3.3.15 → 3.3.18

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.
@@ -59,7 +59,7 @@ public class CapacitorUpdater {
59
59
 
60
60
  public String appId = "";
61
61
  public String deviceID = "";
62
- public final String pluginVersion = "3.3.15";
62
+ public final String pluginVersion = "3.3.18";
63
63
  public String statsUrl = "";
64
64
 
65
65
  public CapacitorUpdater (final Context context) throws PackageManager.NameNotFoundException {
@@ -228,7 +228,7 @@ public class CapacitorUpdaterPlugin extends Plugin implements Application.Activi
228
228
  final JSObject ret = new JSObject();
229
229
  final String current = pathHot.length() >= 10 ? pathHot.substring(pathHot.length() - 10) : "builtin";
230
230
  ret.put("current", current);
231
- ret.put("currentNative", this.currentVersionNative);
231
+ ret.put("currentNative", this.currentVersionNative.toString());
232
232
  call.resolve(ret);
233
233
  }
234
234
 
@@ -28,10 +28,10 @@ extension OperatingSystemVersion {
28
28
  }
29
29
  }
30
30
  extension Bundle {
31
- var releaseVersionNumber: String? {
31
+ var versionName: String? {
32
32
  return infoDictionary?["CFBundleShortVersionString"] as? String
33
33
  }
34
- var buildVersionNumber: String? {
34
+ var versionCode: String? {
35
35
  return infoDictionary?["CFBundleVersion"] as? String
36
36
  }
37
37
  }
@@ -63,8 +63,8 @@ extension CustomError: LocalizedError {
63
63
 
64
64
  @objc public class CapacitorUpdater: NSObject {
65
65
 
66
- private var versionBuild = Bundle.main.releaseVersionNumber ?? ""
67
- private var versionCode = Bundle.main.buildVersionNumber ?? ""
66
+ private var versionBuild = Bundle.main.versionName ?? ""
67
+ private var versionCode = Bundle.main.versionCode ?? ""
68
68
  private var versionOs = ProcessInfo().operatingSystemVersion.getFullVersion()
69
69
  private var lastPathHot = ""
70
70
  private var lastPathPersist = ""
@@ -19,7 +19,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
19
19
 
20
20
  override public func load() {
21
21
  do {
22
- currentVersionNative = try Version(Bundle.main.buildVersionNumber ?? "0.0.0")
22
+ currentVersionNative = try Version(Bundle.main.versionName ?? "0.0.0")
23
23
  } catch {
24
24
  print("✨ Capacitor-updater: Cannot get version native \(currentVersionNative)")
25
25
  }
@@ -49,7 +49,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
49
49
  _ = implementation.delete(version: version, versionName: "")
50
50
  }
51
51
  }
52
- UserDefaults.standard.set( Bundle.main.buildVersionNumber, forKey: "LatestVersionNative")
52
+ UserDefaults.standard.set( Bundle.main.versionName, forKey: "LatestVersionNative")
53
53
  }
54
54
  if (!autoUpdate || autoUpdateUrl == "") { return }
55
55
  let nc = NotificationCenter.default
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-updater",
3
- "version": "3.3.15",
3
+ "version": "3.3.18",
4
4
  "license": "LGPL-3.0-only",
5
5
  "description": "OTA update for capacitor apps",
6
6
  "main": "dist/plugin.cjs.js",
@@ -67,7 +67,7 @@
67
67
  "typescript": "^4.6.2"
68
68
  },
69
69
  "peerDependencies": {
70
- "@capacitor/core": "^3.0.0"
70
+ "@capacitor/core": "^3.0.0 || ^4.0.0"
71
71
  },
72
72
  "prettier": "@ionic/prettier-config",
73
73
  "swiftlint": "@ionic/swiftlint-config",