@capgo/capacitor-updater 4.2.4 → 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.
- package/android/src/main/java/ee/forgr/capacitor_updater/CapacitorUpdater.java +1 -1
- package/android/src/main/java/ee/forgr/capacitor_updater/CapacitorUpdaterPlugin.java +7 -4
- package/ios/Plugin/BundleInfo.swift +1 -1
- package/ios/Plugin/CapacitorUpdater.swift +1 -1
- package/ios/Plugin/CapacitorUpdaterPlugin.swift +2 -2
- 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.2.
|
|
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
|
|
201
|
-
call.reject("download
|
|
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
|
|
|
@@ -40,7 +40,7 @@ import Foundation
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
public func isDownloaded() -> Bool {
|
|
43
|
-
return !self.isBuiltin() && self.downloaded != "" && self.downloaded
|
|
43
|
+
return !self.isBuiltin() && self.downloaded != "" && self.downloaded != BundleInfo.DOWNLOADED_BUILTIN
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
public func getDownloaded() -> String {
|
|
@@ -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.
|
|
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
|
|
109
|
+
print("\(self.implementation.TAG) Failed to download from: \(url ?? "") \(error.localizedDescription)")
|
|
110
110
|
self.notifyListeners("downloadFailed", data: ["version": version])
|
|
111
|
-
call.reject("download
|
|
111
|
+
call.reject("Failed to download from: \(url ?? "")", error.localizedDescription)
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
|