@capgo/capacitor-updater 4.33.0 → 4.34.0

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.
@@ -55,7 +55,7 @@ public class CapacitorUpdaterPlugin
55
55
  private static final String channelUrlDefault =
56
56
  "https://api.capgo.app/channel_self";
57
57
 
58
- private final String PLUGIN_VERSION = "4.33.0";
58
+ private final String PLUGIN_VERSION = "4.34.0";
59
59
  private static final String DELAY_CONDITION_PREFERENCES = "";
60
60
 
61
61
  private SharedPreferences.Editor editor;
@@ -340,7 +340,7 @@ extension CustomError: LocalizedError {
340
340
  }
341
341
 
342
342
  private func decryptFile(filePath: URL, sessionKey: String) throws {
343
- if (self.privateKey ?? "").isEmpty || (sessionKey ?? "").isEmpty {
343
+ if self.privateKey.isEmpty || sessionKey.isEmpty {
344
344
  print("\(self.TAG) Cannot found privateKey or sessionKey")
345
345
  return
346
346
  }
@@ -443,7 +443,7 @@ extension CustomError: LocalizedError {
443
443
  private func setCurrentBundle(bundle: String) {
444
444
  UserDefaults.standard.set(bundle, forKey: self.CAP_SERVER_PATH)
445
445
  UserDefaults.standard.synchronize()
446
- print("\(self.TAG) Current bundle set to: \((bundle ?? "").isEmpty ? BundleInfo.ID_BUILTIN : bundle)")
446
+ print("\(self.TAG) Current bundle set to: \((bundle ).isEmpty ? BundleInfo.ID_BUILTIN : bundle)")
447
447
  }
448
448
 
449
449
  public func download(url: URL, version: String, sessionKey: String) throws -> BundleInfo {
@@ -632,7 +632,7 @@ extension CustomError: LocalizedError {
632
632
 
633
633
  func setChannel(channel: String) -> SetChannel {
634
634
  let setChannel: SetChannel = SetChannel()
635
- if (self.channelUrl ?? "").isEmpty {
635
+ if (self.channelUrl ).isEmpty {
636
636
  print("\(self.TAG) Channel URL is not set")
637
637
  setChannel.message = "Channel URL is not set"
638
638
  setChannel.error = "missing_config"
@@ -657,7 +657,7 @@ extension CustomError: LocalizedError {
657
657
  setChannel.message = message
658
658
  }
659
659
  case let .failure(error):
660
- print("\(self.TAG) Error set Channel", response.value, error)
660
+ print("\(self.TAG) Error set Channel", response.value!, error)
661
661
  setChannel.message = "Error set Channel \(String(describing: response.value))"
662
662
  setChannel.error = "response_error"
663
663
  }
@@ -669,7 +669,7 @@ extension CustomError: LocalizedError {
669
669
 
670
670
  func getChannel() -> GetChannel {
671
671
  let getChannel: GetChannel = GetChannel()
672
- if (self.channelUrl ?? "").isEmpty {
672
+ if (self.channelUrl ).isEmpty {
673
673
  print("\(self.TAG) Channel URL is not set")
674
674
  getChannel.message = "Channel URL is not set"
675
675
  getChannel.error = "missing_config"
@@ -709,7 +709,7 @@ extension CustomError: LocalizedError {
709
709
  }
710
710
 
711
711
  func sendStats(action: String, versionName: String) {
712
- if (self.statsUrl ?? "").isEmpty {
712
+ if (self.statsUrl ).isEmpty {
713
713
  return
714
714
  }
715
715
  var parameters: InfoObject = self.createInfoObject()
@@ -721,7 +721,7 @@ extension CustomError: LocalizedError {
721
721
  case .success:
722
722
  print("\(self.TAG) Stats send for \(action), version \(versionName)")
723
723
  case let .failure(error):
724
- print("\(self.TAG) Error sending stats: ", response.value, error)
724
+ print("\(self.TAG) Error sending stats: ", response.value!, error)
725
725
  }
726
726
  }
727
727
  }
@@ -804,7 +804,7 @@ extension CustomError: LocalizedError {
804
804
  guard let bundlePath: String = UserDefaults.standard.string(forKey: self.CAP_SERVER_PATH) else {
805
805
  return BundleInfo.ID_BUILTIN
806
806
  }
807
- if (bundlePath ?? "").isEmpty {
807
+ if (bundlePath ).isEmpty {
808
808
  return BundleInfo.ID_BUILTIN
809
809
  }
810
810
  let bundleID: String = bundlePath.components(separatedBy: "/").last ?? bundlePath
@@ -15,7 +15,7 @@ import Version
15
15
  @objc(CapacitorUpdaterPlugin)
16
16
  public class CapacitorUpdaterPlugin: CAPPlugin {
17
17
  private var implementation = CapacitorUpdater()
18
- private let PLUGIN_VERSION: String = "4.33.0"
18
+ private let PLUGIN_VERSION: String = "4.34.0"
19
19
  static let updateUrlDefault = "https://api.capgo.app/updates"
20
20
  static let statsUrlDefault = "https://api.capgo.app/stats"
21
21
  static let channelUrlDefault = "https://api.capgo.app/channel_self"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-updater",
3
- "version": "4.33.0",
3
+ "version": "4.34.0",
4
4
  "packageManager": "pnpm@8.1.0",
5
5
  "license": "MPL-2.0",
6
6
  "description": "Live update for capacitor apps",