@capgo/capacitor-updater 4.3.3 → 4.3.5
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.3.
|
|
48
|
+
public static final String pluginVersion = "4.3.5";
|
|
49
49
|
|
|
50
50
|
public SharedPreferences.Editor editor;
|
|
51
51
|
public SharedPreferences prefs;
|
|
@@ -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.3.
|
|
149
|
+
public let pluginVersion = "4.3.5"
|
|
150
150
|
public var statsUrl = ""
|
|
151
151
|
public var appId = ""
|
|
152
152
|
public var deviceID = UIDevice.current.identifierForVendor?.uuidString ?? ""
|
|
@@ -453,7 +453,7 @@ extension CustomError: LocalizedError {
|
|
|
453
453
|
}
|
|
454
454
|
|
|
455
455
|
func sendStats(action: String, versionName: String) {
|
|
456
|
-
if statsUrl == "" { return }
|
|
456
|
+
if self.statsUrl == "" { return }
|
|
457
457
|
let parameters: [String: String] = [
|
|
458
458
|
"platform": "ios",
|
|
459
459
|
"action": action,
|
|
@@ -33,7 +33,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
|
|
|
33
33
|
}
|
|
34
34
|
autoDeleteFailed = getConfig().getBoolean("autoDeleteFailed", true)
|
|
35
35
|
autoDeletePrevious = getConfig().getBoolean("autoDeletePrevious", true)
|
|
36
|
-
updateUrl = getConfig().getString("updateUrl"
|
|
36
|
+
updateUrl = getConfig().getString("updateUrl", CapacitorUpdaterPlugin.updateUrlDefault)!
|
|
37
37
|
autoUpdate = getConfig().getBoolean("autoUpdate", true)
|
|
38
38
|
appReadyTimeout = getConfig().getInt("appReadyTimeout", 10000)
|
|
39
39
|
resetWhenUpdate = getConfig().getBoolean("resetWhenUpdate", true)
|
|
@@ -44,14 +44,14 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
|
|
|
44
44
|
if config?["appId"] != nil {
|
|
45
45
|
implementation.appId = config?["appId"] as! String
|
|
46
46
|
}
|
|
47
|
-
implementation.statsUrl = getConfig().getString("statsUrl"
|
|
47
|
+
implementation.statsUrl = getConfig().getString("statsUrl", CapacitorUpdaterPlugin.statsUrlDefault)!
|
|
48
48
|
if resetWhenUpdate {
|
|
49
49
|
self.cleanupObsoleteVersions()
|
|
50
50
|
}
|
|
51
51
|
let nc = NotificationCenter.default
|
|
52
52
|
nc.addObserver(self, selector: #selector(appMovedToBackground), name: UIApplication.didEnterBackgroundNotification, object: nil)
|
|
53
53
|
nc.addObserver(self, selector: #selector(appMovedToForeground), name: UIApplication.willEnterForegroundNotification, object: nil)
|
|
54
|
-
|
|
54
|
+
nc.addObserver(self, selector: #selector(appKilled), name: UIApplication.willTerminateNotification, object: nil)
|
|
55
55
|
self.appMovedToForeground()
|
|
56
56
|
}
|
|
57
57
|
|
|
@@ -515,6 +515,10 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
|
|
|
515
515
|
}
|
|
516
516
|
|
|
517
517
|
}
|
|
518
|
+
|
|
519
|
+
@objc func appKilled(){
|
|
520
|
+
self._checkCancelDelay(killed: true)
|
|
521
|
+
}
|
|
518
522
|
|
|
519
523
|
private func installNext() {
|
|
520
524
|
let delayUpdatePreferences = UserDefaults.standard.string(forKey: DELAY_CONDITION_PREFERENCES) ?? "[]"
|