@capgo/capacitor-updater 7.0.56 → 7.1.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.
@@ -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 = "7.0.56";
60
+ private final String PLUGIN_VERSION = "7.1.0";
61
61
  private static final String DELAY_CONDITION_PREFERENCES = "";
62
62
 
63
63
  private SharedPreferences.Editor editor;
@@ -1106,6 +1106,20 @@ public class CapacitorUpdaterPlugin extends Plugin {
1106
1106
  "Latest bundle already exists and download is NOT required. " + messageUpdate
1107
1107
  );
1108
1108
  if (CapacitorUpdaterPlugin.this.implementation.directUpdate) {
1109
+ Gson gson = new Gson();
1110
+ String delayUpdatePreferences = prefs.getString(DELAY_CONDITION_PREFERENCES, "[]");
1111
+ Type type = new TypeToken<ArrayList<DelayCondition>>() {}.getType();
1112
+ ArrayList<DelayCondition> delayConditionList = gson.fromJson(delayUpdatePreferences, type);
1113
+ if (delayConditionList != null && !delayConditionList.isEmpty()) {
1114
+ Log.i(CapacitorUpdater.TAG, "Update delayed until delay conditions met");
1115
+ CapacitorUpdaterPlugin.this.endBackGroundTaskWithNotif(
1116
+ "Update delayed until delay conditions met",
1117
+ latestVersionName,
1118
+ latest,
1119
+ false
1120
+ );
1121
+ return;
1122
+ }
1109
1123
  CapacitorUpdaterPlugin.this.implementation.set(latest);
1110
1124
  CapacitorUpdaterPlugin.this._reload();
1111
1125
  CapacitorUpdaterPlugin.this.endBackGroundTaskWithNotif(
@@ -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 = "7.0.56"
48
+ private let PLUGIN_VERSION: String = "7.1.0"
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"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-updater",
3
- "version": "7.0.56",
3
+ "version": "7.1.0",
4
4
  "license": "MPL-2.0",
5
5
  "description": "Live update for capacitor apps",
6
6
  "main": "dist/plugin.cjs.js",