@capgo/capacitor-updater 4.52.0 → 4.54.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.52.0";
58
+ private final String PLUGIN_VERSION = "4.54.0";
59
59
  private static final String DELAY_CONDITION_PREFERENCES = "";
60
60
 
61
61
  private SharedPreferences.Editor editor;
@@ -63,6 +63,7 @@ public class CapacitorUpdaterPlugin
63
63
  private CapacitorUpdater implementation;
64
64
 
65
65
  private Integer appReadyTimeout = 10000;
66
+ private Integer counterActivityCreate = 0;
66
67
  private Boolean autoDeleteFailed = true;
67
68
  private Boolean autoDeletePrevious = true;
68
69
  private Boolean autoUpdate = false;
@@ -1181,7 +1182,6 @@ public class CapacitorUpdaterPlugin
1181
1182
  "app_moved_to_foreground",
1182
1183
  current.getVersionName()
1183
1184
  );
1184
- this._checkCancelDelay(true);
1185
1185
  if (CapacitorUpdaterPlugin.this._isAutoUpdateEnabled()) {
1186
1186
  this.backgroundDownload();
1187
1187
  }
@@ -1269,6 +1269,11 @@ public class CapacitorUpdaterPlugin
1269
1269
  }
1270
1270
  }
1271
1271
 
1272
+ private void appKilled() {
1273
+ Log.d(CapacitorUpdater.TAG, "onActivityDestroyed: all activity destroyed");
1274
+ this._checkCancelDelay(true);
1275
+ }
1276
+
1272
1277
  @Override
1273
1278
  public void onActivityStarted(@NonNull final Activity activity) {
1274
1279
  if (isPreviousMainActivity) {
@@ -1306,6 +1311,7 @@ public class CapacitorUpdaterPlugin
1306
1311
  @Nullable final Bundle savedInstanceState
1307
1312
  ) {
1308
1313
  this.implementation.activity = activity;
1314
+ this.counterActivityCreate++;
1309
1315
  }
1310
1316
 
1311
1317
  @Override
@@ -1319,5 +1325,9 @@ public class CapacitorUpdaterPlugin
1319
1325
  @Override
1320
1326
  public void onActivityDestroyed(@NonNull final Activity activity) {
1321
1327
  this.implementation.activity = activity;
1328
+ counterActivityCreate--;
1329
+ if (counterActivityCreate == 0) {
1330
+ this.appKilled();
1331
+ }
1322
1332
  }
1323
1333
  }
@@ -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.52.0"
18
+ private let PLUGIN_VERSION: String = "4.54.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"
@@ -585,6 +585,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
585
585
  }
586
586
 
587
587
  @objc func appKilled() {
588
+ print("\(self.implementation.TAG) onActivityDestroyed: all activity destroyed")
588
589
  self._checkCancelDelay(killed: true)
589
590
  }
590
591
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-updater",
3
- "version": "4.52.0",
3
+ "version": "4.54.0",
4
4
  "packageManager": "pnpm@8.2.0",
5
5
  "license": "MPL-2.0",
6
6
  "description": "Live update for capacitor apps",