@capgo/capacitor-updater 5.3.34 → 5.3.36

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 extends Plugin {
55
55
  private static final String channelUrlDefault =
56
56
  "https://api.capgo.app/channel_self";
57
57
 
58
- private final String PLUGIN_VERSION = "5.3.34";
58
+ private final String PLUGIN_VERSION = "5.3.36";
59
59
  private static final String DELAY_CONDITION_PREFERENCES = "";
60
60
 
61
61
  private SharedPreferences.Editor editor;
@@ -507,9 +507,22 @@ extension CustomError: LocalizedError {
507
507
  })
508
508
  self.saveBundleInfo(id: id, bundle: BundleInfo(id: id, version: version, status: BundleStatus.DOWNLOADING, downloaded: Date(), checksum: checksum))
509
509
  self.notifyDownload(id, 0)
510
+ let reachabilityManager = NetworkReachabilityManager()
511
+ reachabilityManager?.startListening { status in
512
+ switch status {
513
+ case .notReachable:
514
+ // Stop the download request if the network is not reachable
515
+ request.cancel()
516
+ mainError = NSError(domain: NSURLErrorDomain, code: NSURLErrorNotConnectedToInternet, userInfo: nil)
517
+ semaphore.signal()
518
+ default:
519
+ break
520
+ }
521
+ }
510
522
  semaphore.wait()
511
- if mainError != nil {
512
- throw mainError!
523
+ reachabilityManager?.stopListening()
524
+ if let error = mainError {
525
+ throw error
513
526
  }
514
527
  let info: BundleInfo = BundleInfo(id: id, version: version, status: BundleStatus.PENDING, downloaded: Date(), checksum: checksum)
515
528
  self.saveBundleInfo(id: id, bundle: info)
@@ -15,7 +15,7 @@ import Version
15
15
  @objc(CapacitorUpdaterPlugin)
16
16
  public class CapacitorUpdaterPlugin: CAPPlugin {
17
17
  public var implementation = CapacitorUpdater()
18
- private let PLUGIN_VERSION: String = "5.3.34"
18
+ private let PLUGIN_VERSION: String = "5.3.36"
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,7 +1,7 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-updater",
3
- "version": "5.3.34",
4
- "packageManager": "pnpm@8.10.5",
3
+ "version": "5.3.36",
4
+ "packageManager": "pnpm@8.11.0",
5
5
  "license": "MPL-2.0",
6
6
  "description": "Live update for capacitor apps",
7
7
  "main": "dist/plugin.cjs.js",