@capgo/capacitor-updater 4.12.8 → 4.12.10
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.
|
|
64
|
+
public static final String pluginVersion = "4.12.10";
|
|
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.
|
|
224
|
+
public let pluginVersion = "4.12.10"
|
|
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
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
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.
|
|
3
|
+
"version": "4.12.10",
|
|
4
4
|
"license": "LGPL-3.0-only",
|
|
5
5
|
"description": "OTA update for capacitor apps",
|
|
6
6
|
"main": "dist/plugin.cjs.js",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"eslint": "^8.28.0",
|
|
66
66
|
"eslint-plugin-import": "^2.26.0",
|
|
67
67
|
"prettier": "^2.8.0",
|
|
68
|
-
"prettier-plugin-java": "^
|
|
68
|
+
"prettier-plugin-java": "^2.0.0",
|
|
69
69
|
"rimraf": "^3.0.2",
|
|
70
70
|
"rollup": "^3.4.0",
|
|
71
71
|
"swiftlint": "^1.0.1",
|