@capgo/capacitor-updater 4.0.0-alpha.30 → 4.0.0-alpha.31

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.
@@ -46,7 +46,7 @@ public class CapacitorUpdater {
46
46
  private static final String bundleDirectory = "versions";
47
47
 
48
48
  public static final String TAG = "Capacitor-updater";
49
- public static final String pluginVersion = "4.0.0-alpha.30";
49
+ public static final String pluginVersion = "4.0.0-alpha.31";
50
50
 
51
51
  public SharedPreferences.Editor editor;
52
52
  public SharedPreferences prefs;
@@ -566,7 +566,7 @@ public class CapacitorUpdaterPlugin extends Plugin implements Application.Activi
566
566
 
567
567
  final String url = (String) res.get("url");
568
568
  final BundleInfo next = CapacitorUpdaterPlugin.this.implementation.download(url, latestVersionName);
569
-
569
+ this.notifyListeners("updateAvailable", next);
570
570
  CapacitorUpdaterPlugin.this.implementation.setNextBundle(next.getId());
571
571
  } catch (final Exception e) {
572
572
  Log.e(CapacitorUpdater.TAG, "error downloading file", e);
@@ -148,7 +148,7 @@ extension CustomError: LocalizedError {
148
148
 
149
149
  public let TAG = "✨ Capacitor-updater:";
150
150
  public let CAP_SERVER_PATH = "serverBasePath"
151
- public let pluginVersion = "4.0.0-alpha.30"
151
+ public let pluginVersion = "4.0.0-alpha.31"
152
152
  public var statsUrl = ""
153
153
  public var appId = ""
154
154
  public var deviceID = UIDevice.current.identifierForVendor?.uuidString ?? ""
@@ -380,7 +380,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
380
380
  do {
381
381
  print("\(self.implementation.TAG) New bundle: \(latestVersionName!) found. Current is: \(current.getVersionName()). Update will occur next time app moves to background.")
382
382
  let next = try self.implementation.download(url: downloadUrl, version: latestVersionName!)
383
-
383
+ self.notifyListeners("updateAvailable", data: ["version": next.toJSON()])
384
384
  let _ = self.implementation.setNextBundle(next: next.getId())
385
385
  } catch {
386
386
  print("\(self.implementation.TAG) Error downloading file", error.localizedDescription)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-updater",
3
- "version": "4.0.0-alpha.30",
3
+ "version": "4.0.0-alpha.31",
4
4
  "license": "AGPL-3.0-only",
5
5
  "description": "OTA update for capacitor apps",
6
6
  "main": "dist/plugin.cjs.js",