@capgo/capacitor-updater 6.14.25 → 6.14.26

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.
@@ -57,7 +57,7 @@ public class CapacitorUpdaterPlugin extends Plugin {
57
57
  private static final String statsUrlDefault = "https://plugin.capgo.app/stats";
58
58
  private static final String channelUrlDefault = "https://plugin.capgo.app/channel_self";
59
59
 
60
- private final String PLUGIN_VERSION = "6.14.25";
60
+ private final String PLUGIN_VERSION = "6.14.26";
61
61
  private static final String DELAY_CONDITION_PREFERENCES = "";
62
62
 
63
63
  private SharedPreferences.Editor editor;
@@ -65,7 +65,6 @@ public class CapacitorUpdaterPlugin extends Plugin {
65
65
  protected CapacitorUpdater implementation;
66
66
 
67
67
  private Integer appReadyTimeout = 10000;
68
- private Integer counterActivityCreate = 0;
69
68
  private Integer periodCheckDelay = 0;
70
69
  private Boolean autoDeleteFailed = true;
71
70
  private Boolean autoDeletePrevious = true;
@@ -108,7 +107,6 @@ public class CapacitorUpdaterPlugin extends Plugin {
108
107
  @Override
109
108
  public void load() {
110
109
  super.load();
111
- this.counterActivityCreate++;
112
110
  this.prefs = this.getContext().getSharedPreferences(WebView.WEBVIEW_PREFS_NAME, Activity.MODE_PRIVATE);
113
111
  this.editor = this.prefs.edit();
114
112
 
@@ -199,6 +197,11 @@ public class CapacitorUpdaterPlugin extends Plugin {
199
197
  if (resetWhenUpdate) {
200
198
  this.cleanupObsoleteVersions();
201
199
  }
200
+
201
+ // Check for 'kill' delay condition on app launch
202
+ // This handles cases where the app was killed by the system (onDestroy is not reliable)
203
+ this._checkCancelDelay(true);
204
+
202
205
  this.checkForUpdateAfterDelay();
203
206
  }
204
207
 
@@ -1411,11 +1414,6 @@ public class CapacitorUpdaterPlugin extends Plugin {
1411
1414
  }
1412
1415
  }
1413
1416
 
1414
- private void appKilled() {
1415
- Log.d(CapacitorUpdater.TAG, "onActivityDestroyed: all activity destroyed");
1416
- this._checkCancelDelay(true);
1417
- }
1418
-
1419
1417
  @Override
1420
1418
  public void handleOnStart() {
1421
1419
  if (isPreviousMainActivity) {
@@ -1450,9 +1448,5 @@ public class CapacitorUpdaterPlugin extends Plugin {
1450
1448
  public void handleOnDestroy() {
1451
1449
  Log.i(CapacitorUpdater.TAG, "onActivityDestroyed " + getActivity().getClass().getName());
1452
1450
  this.implementation.activity = getActivity();
1453
- counterActivityCreate--;
1454
- if (counterActivityCreate == 0) {
1455
- this.appKilled();
1456
- }
1457
1451
  }
1458
1452
  }
@@ -45,7 +45,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin, CAPBridgedPlugin {
45
45
  CAPPluginMethod(name: "getNextBundle", returnType: CAPPluginReturnPromise)
46
46
  ]
47
47
  public var implementation = CapacitorUpdater()
48
- private let PLUGIN_VERSION: String = "6.14.25"
48
+ private let PLUGIN_VERSION: String = "6.14.26"
49
49
  static let updateUrlDefault = "https://plugin.capgo.app/updates"
50
50
  static let statsUrlDefault = "https://plugin.capgo.app/stats"
51
51
  static let channelUrlDefault = "https://plugin.capgo.app/channel_self"
@@ -144,7 +144,11 @@ public class CapacitorUpdaterPlugin: CAPPlugin, CAPBridgedPlugin {
144
144
  let nc = NotificationCenter.default
145
145
  nc.addObserver(self, selector: #selector(appMovedToBackground), name: UIApplication.didEnterBackgroundNotification, object: nil)
146
146
  nc.addObserver(self, selector: #selector(appMovedToForeground), name: UIApplication.willEnterForegroundNotification, object: nil)
147
- nc.addObserver(self, selector: #selector(appKilled), name: UIApplication.willTerminateNotification, object: nil)
147
+
148
+ // Check for 'kill' delay condition on app launch
149
+ // This handles cases where the app was killed (willTerminateNotification is not reliable for system kills)
150
+ self._checkCancelDelay(killed: true)
151
+
148
152
  self.appMovedToForeground()
149
153
  self.checkForUpdateAfterDelay()
150
154
  }
@@ -898,11 +902,6 @@ public class CapacitorUpdaterPlugin: CAPPlugin, CAPBridgedPlugin {
898
902
  }
899
903
  }
900
904
 
901
- @objc func appKilled() {
902
- print("\(CapacitorUpdater.TAG) onActivityDestroyed: all activity destroyed")
903
- self._checkCancelDelay(killed: true)
904
- }
905
-
906
905
  private func installNext() {
907
906
  let delayUpdatePreferences = UserDefaults.standard.string(forKey: DELAY_CONDITION_PREFERENCES) ?? "[]"
908
907
  let delayConditionList: [DelayCondition]? = fromJsonArr(json: delayUpdatePreferences).map { obj -> DelayCondition in
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-updater",
3
- "version": "6.14.25",
3
+ "version": "6.14.26",
4
4
  "license": "MPL-2.0",
5
5
  "description": "Live update for capacitor apps",
6
6
  "main": "dist/plugin.cjs.js",