@capgo/capacitor-updater 4.10.4 → 4.11.3

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.
@@ -52,7 +52,7 @@ public class CapacitorUpdater {
52
52
  private static final String bundleDirectory = "versions";
53
53
 
54
54
  public static final String TAG = "Capacitor-updater";
55
- public static final String pluginVersion = "4.10.4";
55
+ public static final String pluginVersion = "4.11.3";
56
56
 
57
57
  public SharedPreferences.Editor editor;
58
58
  public SharedPreferences prefs;
@@ -145,11 +145,14 @@ public class CapacitorUpdaterPlugin extends Plugin implements Application.Activi
145
145
  try {
146
146
  final JSObject ret = new JSObject();
147
147
  ret.put("percent", percent);
148
- JSObject bundle = this.implementation.getBundleInfo(id).toJSON();
149
- ret.put("bundle", bundle);
148
+ final BundleInfo bundleInfo = this.implementation.getBundleInfo(id);
149
+ ret.put("bundle", bundleInfo.toJSON());
150
150
  this.notifyListeners("download", ret);
151
151
  if (percent == 100) {
152
- this.notifyListeners("downloadComplete", bundle);
152
+ this.notifyListeners("downloadComplete", bundleInfo.toJSON());
153
+ this.implementation.sendStats("download_complete", bundleInfo.getVersionName());
154
+ } else if (percent % 10 == 0) {
155
+ this.implementation.sendStats("download_" + percent, bundleInfo.getVersionName());
153
156
  }
154
157
  } catch (final Exception e) {
155
158
  Log.e(CapacitorUpdater.TAG, "Could not notify listeners", e);
@@ -208,7 +208,7 @@ extension CustomError: LocalizedError {
208
208
  public let TAG = "✨ Capacitor-updater:"
209
209
  public let CAP_SERVER_PATH = "serverBasePath"
210
210
  public var customId = ""
211
- public let pluginVersion = "4.10.4"
211
+ public let pluginVersion = "4.11.3"
212
212
  public var statsUrl = ""
213
213
  public var channelUrl = ""
214
214
  public var appId = ""
@@ -84,6 +84,10 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
84
84
  self.notifyListeners("download", data: ["percent": percent, "bundle": bundle.toJSON()])
85
85
  if percent == 100 {
86
86
  self.notifyListeners("downloadComplete", data: ["bundle": bundle.toJSON()])
87
+ self.implementation.sendStats(action: "download_complete", versionName: bundle.getVersionName())
88
+ }
89
+ else if percent.isMultiple(of: 10) {
90
+ self.implementation.sendStats(action: "download_\(percent)", versionName: bundle.getVersionName())
87
91
  }
88
92
  }
89
93
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-updater",
3
- "version": "4.10.4",
3
+ "version": "4.11.3",
4
4
  "license": "LGPL-3.0-only",
5
5
  "description": "OTA update for capacitor apps",
6
6
  "main": "dist/plugin.cjs.js",