@capgo/capacitor-updater 3.0.7 → 3.0.8

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.
@@ -47,7 +47,7 @@ public class CapacitorUpdater {
47
47
  public String statsUrl = "";
48
48
  public String appId = "";
49
49
  public String deviceID = "";
50
- private String pluginVersion = "3.0.7";
50
+ private String pluginVersion = "3.0.8";
51
51
 
52
52
 
53
53
  private FilenameFilter filter = new FilenameFilter() {
@@ -255,17 +255,19 @@ public class CapacitorUpdaterPlugin extends Plugin implements Application.Activi
255
255
  public void run() {
256
256
  implementation.getLatest(autoUpdateUrl, (res) -> {
257
257
  try {
258
- String currentVersion = implementation.getVersionName();
259
- String newVersion = (String) res.get("version");
260
- JSObject ret = new JSObject();
261
- ret.put("newVersion", newVersion);
262
258
  if (res.has("message")) {
263
259
  Log.i(TAG, "Capacitor-updater: " + res.get("message"));
264
- if (res.getBoolean("major")) {
260
+ if (res.has("major") && res.getBoolean("major") && res.has("version")) {
261
+ JSObject ret = new JSObject();
262
+ ret.put("newVersion", (String) res.get("version"));
265
263
  notifyListeners("majorAvailable", ret);
266
264
  }
267
265
  return;
268
266
  }
267
+ String currentVersion = implementation.getVersionName();
268
+ String newVersion = (String) res.get("version");
269
+ JSObject ret = new JSObject();
270
+ ret.put("newVersion", newVersion);
269
271
  String failingVersion = prefs.getString("failingVersion", "");
270
272
  if (!newVersion.equals("") && !newVersion.equals(failingVersion)) {
271
273
  new Thread(new Runnable(){
@@ -37,7 +37,7 @@ extension Bundle {
37
37
  public var appId = ""
38
38
  public var deviceID = UIDevice.current.identifierForVendor?.uuidString ?? ""
39
39
  public var notifyDownload: (Int) -> Void = { _ in }
40
- public var pluginVersion = "3.0.7"
40
+ public var pluginVersion = "3.0.8"
41
41
  private var versionBuild = Bundle.main.releaseVersionNumber ?? ""
42
42
  private var lastPathHot = ""
43
43
  private var lastPathPersist = ""
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-updater",
3
- "version": "3.0.7",
3
+ "version": "3.0.8",
4
4
  "license": "AGPL-3.0-only",
5
5
  "description": "OTA update for capacitor apps",
6
6
  "main": "dist/plugin.cjs.js",