@capgo/capacitor-updater 4.2.5 → 4.2.6

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.
@@ -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.2.5";
48
+ public static final String pluginVersion = "4.2.6";
49
49
 
50
50
  public SharedPreferences.Editor editor;
51
51
  public SharedPreferences prefs;
@@ -197,8 +197,8 @@ public class CapacitorUpdaterPlugin extends Plugin implements Application.Activi
197
197
  final BundleInfo downloaded = CapacitorUpdaterPlugin.this.implementation.download(url, version);
198
198
  call.resolve(downloaded.toJSON());
199
199
  } catch (final IOException e) {
200
- Log.e(CapacitorUpdater.TAG, "download failed", e);
201
- call.reject("download failed", e);
200
+ Log.e(CapacitorUpdater.TAG, "Failed to download from: " + url, e);
201
+ call.reject("Failed to download from: " + url, e);
202
202
  final JSObject ret = new JSObject();
203
203
  ret.put("version", version);
204
204
  CapacitorUpdaterPlugin.this.notifyListeners("downloadFailed", ret);
@@ -208,8 +208,11 @@ public class CapacitorUpdaterPlugin extends Plugin implements Application.Activi
208
208
  )
209
209
  .start();
210
210
  } catch (final Exception e) {
211
- Log.e(CapacitorUpdater.TAG, "Failed to download " + url, e);
212
- call.reject("Failed to download " + url, e);
211
+ Log.e(CapacitorUpdater.TAG, "Failed to download from: " + url, e);
212
+ call.reject("Failed to download from: " + url, e);
213
+ final JSObject ret = new JSObject();
214
+ ret.put("version", version);
215
+ CapacitorUpdaterPlugin.this.notifyListeners("downloadFailed", ret);
213
216
  }
214
217
  }
215
218
 
@@ -146,7 +146,7 @@ extension CustomError: LocalizedError {
146
146
 
147
147
  public let TAG = "✨ Capacitor-updater:"
148
148
  public let CAP_SERVER_PATH = "serverBasePath"
149
- public let pluginVersion = "4.2.5"
149
+ public let pluginVersion = "4.2.6"
150
150
  public var statsUrl = ""
151
151
  public var appId = ""
152
152
  public var deviceID = UIDevice.current.identifierForVendor?.uuidString ?? ""
@@ -106,9 +106,9 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
106
106
  let res = try implementation.download(url: url!, version: version)
107
107
  call.resolve(res.toJSON())
108
108
  } catch {
109
- print("\(self.implementation.TAG) download failed \(error.localizedDescription)")
109
+ print("\(self.implementation.TAG) Failed to download from: \(url ?? "") \(error.localizedDescription)")
110
110
  self.notifyListeners("downloadFailed", data: ["version": version])
111
- call.reject("download failed", error.localizedDescription)
111
+ call.reject("Failed to download from: \(url ?? "")", error.localizedDescription)
112
112
  }
113
113
  }
114
114
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-updater",
3
- "version": "4.2.5",
3
+ "version": "4.2.6",
4
4
  "license": "LGPL-3.0-only",
5
5
  "description": "OTA update for capacitor apps",
6
6
  "main": "dist/plugin.cjs.js",