@capgo/capacitor-updater 4.0.0-alpha.54 → 4.0.0-alpha.57
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.
- package/README.md +13 -12
- package/android/src/main/java/ee/forgr/capacitor_updater/CapacitorUpdater.java +2 -2
- package/android/src/main/java/ee/forgr/capacitor_updater/CapacitorUpdaterPlugin.java +1 -1
- package/ios/Plugin/CapacitorUpdater.swift +1 -1
- package/ios/Plugin/CapacitorUpdaterPlugin.swift +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
1
|
+
# Capacitor updater
|
|
2
|
+
<a href="https://capgo.app/"><img src='https://raw.githubusercontent.com/Cap-go/capgo/main/assets/capgo_banner.png' alt='Capgo - Instant updates for capacitor'/></a>
|
|
3
3
|
Update Ionic Capacitor apps without App/Play Store review (Code-push / hot-code updates).
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
5
|
+
You have 3 ways possible :
|
|
6
|
+
- Use [capgo.app](https://capgo.app) a full featured auto update system in 5 min Setup, to manage version, update, revert and see stats.
|
|
7
|
+
- Use your own server update with auto update system
|
|
8
|
+
- Use manual methods to zip, upload, download, from JS to do it when you want.
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
## Community
|
|
12
12
|
Join the [discord](https://discord.gg/VnYRvBfgA6) to get help.
|
|
13
13
|
|
|
14
14
|
## Documentation
|
|
15
|
-
I maintain a more user friendly and complete [documentation](https://
|
|
15
|
+
I maintain a more user friendly and complete [documentation here](https://docs.capgo.app/).
|
|
16
16
|
|
|
17
17
|
## Installation
|
|
18
18
|
|
|
@@ -24,10 +24,10 @@ npx cap sync
|
|
|
24
24
|
## Auto-update setup
|
|
25
25
|
|
|
26
26
|
Create account in [capgo.app](https://capgo.app) and get your [API key](https://capgo.app/app/apikeys)
|
|
27
|
-
-
|
|
28
|
-
- Add app
|
|
29
|
-
- Upload app `capgo
|
|
30
|
-
-
|
|
27
|
+
- Login to CLI `npx @capgo/cli@latest login API_KEY`
|
|
28
|
+
- Add app with CLI `npx @capgo/cli@latest add`
|
|
29
|
+
- Upload app to channel production `npx @capgo/cli@latest upload -c production`
|
|
30
|
+
- Set channel production public `npx @capgo/cli@latest set -c production -s public`
|
|
31
31
|
- Edit your `capacitor.config.json` like below, set `autoUpdate` to true.
|
|
32
32
|
```json
|
|
33
33
|
// capacitor.config.json
|
|
@@ -52,7 +52,8 @@ This tells Capacitor Updator that the current update bundle has loaded succesful
|
|
|
52
52
|
- Run the app and see app auto update after each backgrounding.
|
|
53
53
|
- Failed updates will automatically roll back to the last successful version.
|
|
54
54
|
|
|
55
|
-
See more
|
|
55
|
+
See more there in the [Auto update](
|
|
56
|
+
https://github.com/Cap-go/capacitor-updater/wiki) documentation.
|
|
56
57
|
|
|
57
58
|
|
|
58
59
|
## Manual setup
|
|
@@ -47,7 +47,7 @@ public class CapacitorUpdater {
|
|
|
47
47
|
private static final String bundleDirectory = "versions";
|
|
48
48
|
|
|
49
49
|
public static final String TAG = "Capacitor-updater";
|
|
50
|
-
public static final String pluginVersion = "4.0.0-alpha.
|
|
50
|
+
public static final String pluginVersion = "4.0.0-alpha.57";
|
|
51
51
|
|
|
52
52
|
public SharedPreferences.Editor editor;
|
|
53
53
|
public SharedPreferences prefs;
|
|
@@ -261,7 +261,7 @@ public class CapacitorUpdater {
|
|
|
261
261
|
|
|
262
262
|
public Boolean delete(final String id, final Boolean removeInfo) throws IOException {
|
|
263
263
|
final BundleInfo deleted = this.getBundleInfo(id);
|
|
264
|
-
if (deleted.isBuiltin() ||
|
|
264
|
+
if (deleted.isBuiltin() || this.getCurrentBundleId() == id) {
|
|
265
265
|
Log.e(TAG, "Cannot delete " + id);
|
|
266
266
|
return false;
|
|
267
267
|
}
|
|
@@ -578,10 +578,10 @@ public class CapacitorUpdaterPlugin extends Plugin implements Application.Activi
|
|
|
578
578
|
}
|
|
579
579
|
if(latest.isDownloaded()){
|
|
580
580
|
Log.e(CapacitorUpdater.TAG, "Latest bundle already exists and download is NOT required. Update will occur next time app moves to background.");
|
|
581
|
-
CapacitorUpdaterPlugin.this.implementation.setNextBundle(latest.getId());
|
|
582
581
|
final JSObject ret = new JSObject();
|
|
583
582
|
ret.put("bundle", latest.toJSON());
|
|
584
583
|
CapacitorUpdaterPlugin.this.notifyListeners("updateAvailable", ret);
|
|
584
|
+
CapacitorUpdaterPlugin.this.implementation.setNextBundle(latest.getId());
|
|
585
585
|
return;
|
|
586
586
|
}
|
|
587
587
|
}
|
|
@@ -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.0.0-alpha.
|
|
149
|
+
public let pluginVersion = "4.0.0-alpha.57"
|
|
150
150
|
public var statsUrl = ""
|
|
151
151
|
public var appId = ""
|
|
152
152
|
public var deviceID = UIDevice.current.identifierForVendor?.uuidString ?? ""
|
|
@@ -392,8 +392,8 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
|
|
|
392
392
|
}
|
|
393
393
|
if(latest!.isDownloaded()){
|
|
394
394
|
print("\(self.implementation.TAG) Latest version already exists and download is NOT required. Update will occur next time app moves to background.")
|
|
395
|
-
let _ = self.implementation.setNextBundle(next: latest!.getId())
|
|
396
395
|
self.notifyListeners("updateAvailable", data: ["bundle": current.toJSON()])
|
|
396
|
+
let _ = self.implementation.setNextBundle(next: latest!.getId())
|
|
397
397
|
return
|
|
398
398
|
}
|
|
399
399
|
}
|