@capgo/capacitor-updater 4.4.10 → 4.4.11
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.
- package/android/src/main/java/ee/forgr/capacitor_updater/CapacitorUpdater.java +1 -1
- package/android/src/main/java/ee/forgr/capacitor_updater/CapacitorUpdaterPlugin.java +4 -0
- package/ios/Plugin/CapacitorUpdater.swift +1 -1
- package/ios/Plugin/CapacitorUpdaterPlugin.swift +5 -1
- package/package.json +1 -1
|
@@ -45,7 +45,7 @@ public class CapacitorUpdater {
|
|
|
45
45
|
private static final String bundleDirectory = "versions";
|
|
46
46
|
|
|
47
47
|
public static final String TAG = "Capacitor-updater";
|
|
48
|
-
public static final String pluginVersion = "4.4.
|
|
48
|
+
public static final String pluginVersion = "4.4.11";
|
|
49
49
|
|
|
50
50
|
public SharedPreferences.Editor editor;
|
|
51
51
|
public SharedPreferences prefs;
|
|
@@ -207,6 +207,8 @@ public class CapacitorUpdaterPlugin extends Plugin implements Application.Activi
|
|
|
207
207
|
final JSObject ret = new JSObject();
|
|
208
208
|
ret.put("version", version);
|
|
209
209
|
CapacitorUpdaterPlugin.this.notifyListeners("downloadFailed", ret);
|
|
210
|
+
final BundleInfo current = CapacitorUpdaterPlugin.this.implementation.getCurrentBundle();
|
|
211
|
+
CapacitorUpdaterPlugin.this.implementation.sendStats("download_fail", current.getVersionName());
|
|
210
212
|
}
|
|
211
213
|
}
|
|
212
214
|
}
|
|
@@ -713,6 +715,8 @@ public class CapacitorUpdaterPlugin extends Plugin implements Application.Activi
|
|
|
713
715
|
final JSObject ret = new JSObject();
|
|
714
716
|
ret.put("version", latestVersionName);
|
|
715
717
|
CapacitorUpdaterPlugin.this.notifyListeners("downloadFailed", ret);
|
|
718
|
+
final BundleInfo current = CapacitorUpdaterPlugin.this.implementation.getCurrentBundle();
|
|
719
|
+
CapacitorUpdaterPlugin.this.implementation.sendStats("download_fail", current.getVersionName());
|
|
716
720
|
final JSObject retNoNeed = new JSObject();
|
|
717
721
|
retNoNeed.put("bundle", current.toJSON());
|
|
718
722
|
CapacitorUpdaterPlugin.this.notifyListeners("noNeedUpdate", retNoNeed);
|
|
@@ -148,7 +148,7 @@ extension CustomError: LocalizedError {
|
|
|
148
148
|
|
|
149
149
|
public let TAG = "✨ Capacitor-updater:"
|
|
150
150
|
public let CAP_SERVER_PATH = "serverBasePath"
|
|
151
|
-
public let pluginVersion = "4.4.
|
|
151
|
+
public let pluginVersion = "4.4.11"
|
|
152
152
|
public var statsUrl = ""
|
|
153
153
|
public var appId = ""
|
|
154
154
|
public var deviceID = UIDevice.current.identifierForVendor?.uuidString ?? ""
|
|
@@ -107,11 +107,13 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
|
|
|
107
107
|
let url = URL(string: urlString)
|
|
108
108
|
print("\(self.implementation.TAG) Downloading \(url!)")
|
|
109
109
|
do {
|
|
110
|
-
let res = try implementation.download(url: url!, version: version)
|
|
110
|
+
let res = try self.implementation.download(url: url!, version: version)
|
|
111
111
|
call.resolve(res.toJSON())
|
|
112
112
|
} catch {
|
|
113
113
|
print("\(self.implementation.TAG) Failed to download from: \(url!) \(error.localizedDescription)")
|
|
114
114
|
self.notifyListeners("downloadFailed", data: ["version": version])
|
|
115
|
+
let current: BundleInfo = self.implementation.getCurrentBundle()
|
|
116
|
+
self.implementation.sendStats(action: "download_fail", versionName: current.getVersionName())
|
|
115
117
|
call.reject("Failed to download from: \(url!)", error.localizedDescription)
|
|
116
118
|
}
|
|
117
119
|
}
|
|
@@ -480,6 +482,8 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
|
|
|
480
482
|
_ = self.implementation.setNextBundle(next: next.getId())
|
|
481
483
|
} catch {
|
|
482
484
|
print("\(self.implementation.TAG) Error downloading file", error.localizedDescription)
|
|
485
|
+
let current: BundleInfo = self.implementation.getCurrentBundle()
|
|
486
|
+
self.implementation.sendStats(action: "download_fail", versionName: current.getVersionName())
|
|
483
487
|
self.notifyListeners("downloadFailed", data: ["version": latestVersionName])
|
|
484
488
|
self.notifyListeners("noNeedUpdate", data: ["bundle": current.toJSON()])
|
|
485
489
|
}
|