@capgo/capacitor-updater 4.12.8 → 4.12.9

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.
@@ -61,7 +61,7 @@ public class CapacitorUpdater {
61
61
  private static final String bundleDirectory = "versions";
62
62
 
63
63
  public static final String TAG = "Capacitor-updater";
64
- public static final String pluginVersion = "4.12.8";
64
+ public static final String pluginVersion = "4.12.9";
65
65
 
66
66
  public SharedPreferences.Editor editor;
67
67
  public SharedPreferences prefs;
@@ -221,7 +221,7 @@ extension CustomError: LocalizedError {
221
221
  public let TAG = "✨ Capacitor-updater:"
222
222
  public let CAP_SERVER_PATH = "serverBasePath"
223
223
  public var customId = ""
224
- public let pluginVersion = "4.12.8"
224
+ public let pluginVersion = "4.12.9"
225
225
  public var statsUrl = ""
226
226
  public var channelUrl = ""
227
227
  public var appId = ""
@@ -111,15 +111,17 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
111
111
  }
112
112
  let url = URL(string: urlString)
113
113
  print("\(self.implementation.TAG) Downloading \(url!)")
114
- do {
115
- let res = try self.implementation.download(url: url!, version: version)
116
- call.resolve(res.toJSON())
117
- } catch {
118
- print("\(self.implementation.TAG) Failed to download from: \(url!) \(error.localizedDescription)")
119
- self.notifyListeners("downloadFailed", data: ["version": version])
120
- let current: BundleInfo = self.implementation.getCurrentBundle()
121
- self.implementation.sendStats(action: "download_fail", versionName: current.getVersionName())
122
- call.reject("Failed to download from: \(url!)", error.localizedDescription)
114
+ DispatchQueue.global(qos: .background).async {
115
+ do {
116
+ let res = try self.implementation.download(url: url!, version: version)
117
+ call.resolve(res.toJSON())
118
+ } catch {
119
+ print("\(self.implementation.TAG) Failed to download from: \(url!) \(error.localizedDescription)")
120
+ self.notifyListeners("downloadFailed", data: ["version": version])
121
+ let current: BundleInfo = self.implementation.getCurrentBundle()
122
+ self.implementation.sendStats(action: "download_fail", versionName: current.getVersionName())
123
+ call.reject("Failed to download from: \(url!)", error.localizedDescription)
124
+ }
123
125
  }
124
126
  }
125
127
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-updater",
3
- "version": "4.12.8",
3
+ "version": "4.12.9",
4
4
  "license": "LGPL-3.0-only",
5
5
  "description": "OTA update for capacitor apps",
6
6
  "main": "dist/plugin.cjs.js",