@capgo/capacitor-updater 5.0.21 → 5.2.2
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 +42 -0
- package/android/src/main/java/ee/forgr/capacitor_updater/CapacitorUpdaterPlugin.java +38 -10
- package/dist/docs.json +75 -0
- package/dist/esm/definitions.d.ts +25 -0
- package/dist/esm/web.d.ts +3 -0
- package/dist/esm/web.js +4 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +4 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +4 -0
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/CapacitorUpdater.swift +2 -2
- package/ios/Plugin/CapacitorUpdaterPlugin.swift +37 -26
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -143,6 +143,8 @@ Capacitor Updator works by unzipping a compiled app bundle to the native device
|
|
|
143
143
|
* [`addListener('updateFailed', ...)`](#addlistenerupdatefailed)
|
|
144
144
|
* [`addListener('downloadFailed', ...)`](#addlistenerdownloadfailed)
|
|
145
145
|
* [`addListener('appReloaded', ...)`](#addlistenerappreloaded)
|
|
146
|
+
* [`addListener('appReady', ...)`](#addlistenerappready)
|
|
147
|
+
* [`getBuiltinVersion()`](#getbuiltinversion)
|
|
146
148
|
* [`getDeviceId()`](#getdeviceid)
|
|
147
149
|
* [`getPluginVersion()`](#getpluginversion)
|
|
148
150
|
* [`isAutoUpdateEnabled()`](#isautoupdateenabled)
|
|
@@ -542,6 +544,41 @@ Listen for download fail event in the App, let you know when download has fail f
|
|
|
542
544
|
--------------------
|
|
543
545
|
|
|
544
546
|
|
|
547
|
+
### addListener('appReady', ...)
|
|
548
|
+
|
|
549
|
+
```typescript
|
|
550
|
+
addListener(eventName: "appReady", listenerFunc: AppReadyListener) => Promise<PluginListenerHandle> & PluginListenerHandle
|
|
551
|
+
```
|
|
552
|
+
|
|
553
|
+
Listen for app ready event in the App, let you know when app is ready to use
|
|
554
|
+
|
|
555
|
+
| Param | Type |
|
|
556
|
+
| ------------------ | ------------------------------------------------------------- |
|
|
557
|
+
| **`eventName`** | <code>'appReady'</code> |
|
|
558
|
+
| **`listenerFunc`** | <code><a href="#appreadylistener">AppReadyListener</a></code> |
|
|
559
|
+
|
|
560
|
+
**Returns:** <code>Promise<<a href="#pluginlistenerhandle">PluginListenerHandle</a>> & <a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
|
|
561
|
+
|
|
562
|
+
**Since:** 5.1.0
|
|
563
|
+
|
|
564
|
+
--------------------
|
|
565
|
+
|
|
566
|
+
|
|
567
|
+
### getBuiltinVersion()
|
|
568
|
+
|
|
569
|
+
```typescript
|
|
570
|
+
getBuiltinVersion() => Promise<{ version: string; }>
|
|
571
|
+
```
|
|
572
|
+
|
|
573
|
+
Get the native app version or the builtin version if set in config
|
|
574
|
+
|
|
575
|
+
**Returns:** <code>Promise<{ version: string; }></code>
|
|
576
|
+
|
|
577
|
+
**Since:** 5.2.0
|
|
578
|
+
|
|
579
|
+
--------------------
|
|
580
|
+
|
|
581
|
+
|
|
545
582
|
### getDeviceId()
|
|
546
583
|
|
|
547
584
|
```typescript
|
|
@@ -772,6 +809,11 @@ Remove all listeners for this plugin.
|
|
|
772
809
|
|
|
773
810
|
<code>(state: void): void</code>
|
|
774
811
|
|
|
812
|
+
|
|
813
|
+
#### AppReadyListener
|
|
814
|
+
|
|
815
|
+
<code>(state: void): void</code>
|
|
816
|
+
|
|
775
817
|
</docgen-api>
|
|
776
818
|
|
|
777
819
|
### Listen to download events
|
|
@@ -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 = "5.
|
|
58
|
+
private final String PLUGIN_VERSION = "5.2.2";
|
|
59
59
|
private static final String DELAY_CONDITION_PREFERENCES = "";
|
|
60
60
|
|
|
61
61
|
private SharedPreferences.Editor editor;
|
|
@@ -72,6 +72,7 @@ public class CapacitorUpdaterPlugin
|
|
|
72
72
|
private Boolean resetWhenUpdate = true;
|
|
73
73
|
private Thread backgroundTask;
|
|
74
74
|
private Boolean taskRunning = false;
|
|
75
|
+
private Boolean directUpdate = false;
|
|
75
76
|
|
|
76
77
|
private Boolean isPreviousMainActivity = true;
|
|
77
78
|
|
|
@@ -112,6 +113,7 @@ public class CapacitorUpdaterPlugin
|
|
|
112
113
|
this.implementation.versionCode = Integer.toString(pInfo.versionCode);
|
|
113
114
|
this.implementation.requestQueue =
|
|
114
115
|
Volley.newRequestQueue(this.getContext());
|
|
116
|
+
this.directUpdate = this.getConfig().getBoolean("directUpdate", false);
|
|
115
117
|
this.currentVersionNative =
|
|
116
118
|
new Version(this.getConfig().getString("version", pInfo.versionName));
|
|
117
119
|
} catch (final PackageManager.NameNotFoundException e) {
|
|
@@ -248,6 +250,18 @@ public class CapacitorUpdaterPlugin
|
|
|
248
250
|
}
|
|
249
251
|
}
|
|
250
252
|
|
|
253
|
+
@PluginMethod
|
|
254
|
+
public void getBuiltinVersion(final PluginCall call) {
|
|
255
|
+
try {
|
|
256
|
+
final JSObject ret = new JSObject();
|
|
257
|
+
ret.put("version", this.implementation.versionBuild);
|
|
258
|
+
call.resolve(ret);
|
|
259
|
+
} catch (final Exception e) {
|
|
260
|
+
Log.e(CapacitorUpdater.TAG, "Could not get version", e);
|
|
261
|
+
call.reject("Could not get version", e);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
251
265
|
@PluginMethod
|
|
252
266
|
public void getDeviceId(final PluginCall call) {
|
|
253
267
|
try {
|
|
@@ -907,15 +921,28 @@ public class CapacitorUpdaterPlugin
|
|
|
907
921
|
CapacitorUpdater.TAG,
|
|
908
922
|
"Latest bundle already exists and download is NOT required. Update will occur next time app moves to background."
|
|
909
923
|
);
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
);
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
924
|
+
if (CapacitorUpdaterPlugin.this.directUpdate) {
|
|
925
|
+
CapacitorUpdaterPlugin.this.implementation.set(
|
|
926
|
+
latest
|
|
927
|
+
);
|
|
928
|
+
CapacitorUpdaterPlugin.this._reload();
|
|
929
|
+
final JSObject ret = new JSObject();
|
|
930
|
+
ret.put("bundle", latest.toJSON());
|
|
931
|
+
CapacitorUpdaterPlugin.this.notifyListeners(
|
|
932
|
+
"appReady",
|
|
933
|
+
ret
|
|
934
|
+
);
|
|
935
|
+
} else {
|
|
936
|
+
final JSObject ret = new JSObject();
|
|
937
|
+
ret.put("bundle", latest.toJSON());
|
|
938
|
+
CapacitorUpdaterPlugin.this.notifyListeners(
|
|
939
|
+
"updateAvailable",
|
|
940
|
+
ret
|
|
941
|
+
);
|
|
942
|
+
CapacitorUpdaterPlugin.this.implementation.setNextBundle(
|
|
943
|
+
latest.getId()
|
|
944
|
+
);
|
|
945
|
+
}
|
|
919
946
|
return;
|
|
920
947
|
}
|
|
921
948
|
if (latest.isDeleted()) {
|
|
@@ -1166,6 +1193,7 @@ public class CapacitorUpdaterPlugin
|
|
|
1166
1193
|
"app_moved_to_foreground",
|
|
1167
1194
|
current.getVersionName()
|
|
1168
1195
|
);
|
|
1196
|
+
this._checkCancelDelay(true);
|
|
1169
1197
|
if (CapacitorUpdaterPlugin.this._isAutoUpdateEnabled()) {
|
|
1170
1198
|
this.backgroundDownload();
|
|
1171
1199
|
}
|
package/dist/docs.json
CHANGED
|
@@ -663,6 +663,54 @@
|
|
|
663
663
|
],
|
|
664
664
|
"slug": "addlistenerappreloaded"
|
|
665
665
|
},
|
|
666
|
+
{
|
|
667
|
+
"name": "addListener",
|
|
668
|
+
"signature": "(eventName: \"appReady\", listenerFunc: AppReadyListener) => Promise<PluginListenerHandle> & PluginListenerHandle",
|
|
669
|
+
"parameters": [
|
|
670
|
+
{
|
|
671
|
+
"name": "eventName",
|
|
672
|
+
"docs": "",
|
|
673
|
+
"type": "'appReady'"
|
|
674
|
+
},
|
|
675
|
+
{
|
|
676
|
+
"name": "listenerFunc",
|
|
677
|
+
"docs": "",
|
|
678
|
+
"type": "AppReadyListener"
|
|
679
|
+
}
|
|
680
|
+
],
|
|
681
|
+
"returns": "Promise<PluginListenerHandle> & PluginListenerHandle",
|
|
682
|
+
"tags": [
|
|
683
|
+
{
|
|
684
|
+
"name": "since",
|
|
685
|
+
"text": "5.1.0"
|
|
686
|
+
}
|
|
687
|
+
],
|
|
688
|
+
"docs": "Listen for app ready event in the App, let you know when app is ready to use",
|
|
689
|
+
"complexTypes": [
|
|
690
|
+
"PluginListenerHandle",
|
|
691
|
+
"AppReadyListener"
|
|
692
|
+
],
|
|
693
|
+
"slug": "addlistenerappready"
|
|
694
|
+
},
|
|
695
|
+
{
|
|
696
|
+
"name": "getBuiltinVersion",
|
|
697
|
+
"signature": "() => Promise<{ version: string; }>",
|
|
698
|
+
"parameters": [],
|
|
699
|
+
"returns": "Promise<{ version: string; }>",
|
|
700
|
+
"tags": [
|
|
701
|
+
{
|
|
702
|
+
"name": "returns",
|
|
703
|
+
"text": "an Promise with version for this device"
|
|
704
|
+
},
|
|
705
|
+
{
|
|
706
|
+
"name": "since",
|
|
707
|
+
"text": "5.2.0"
|
|
708
|
+
}
|
|
709
|
+
],
|
|
710
|
+
"docs": "Get the native app version or the builtin version if set in config",
|
|
711
|
+
"complexTypes": [],
|
|
712
|
+
"slug": "getbuiltinversion"
|
|
713
|
+
},
|
|
666
714
|
{
|
|
667
715
|
"name": "getDeviceId",
|
|
668
716
|
"signature": "() => Promise<{ deviceId: string; }>",
|
|
@@ -1328,6 +1376,17 @@
|
|
|
1328
1376
|
"complexTypes": []
|
|
1329
1377
|
}
|
|
1330
1378
|
]
|
|
1379
|
+
},
|
|
1380
|
+
{
|
|
1381
|
+
"name": "AppReadyListener",
|
|
1382
|
+
"slug": "appreadylistener",
|
|
1383
|
+
"docs": "",
|
|
1384
|
+
"types": [
|
|
1385
|
+
{
|
|
1386
|
+
"text": "(state: void): void",
|
|
1387
|
+
"complexTypes": []
|
|
1388
|
+
}
|
|
1389
|
+
]
|
|
1331
1390
|
}
|
|
1332
1391
|
],
|
|
1333
1392
|
"pluginConfigs": [
|
|
@@ -1474,6 +1533,22 @@
|
|
|
1474
1533
|
"docs": "Configure the current version of the app. This will be used for the first update request.\nIf not set, the plugin will get the version from the native code.\n\nOnly available for Android and iOS.",
|
|
1475
1534
|
"complexTypes": [],
|
|
1476
1535
|
"type": "string | undefined"
|
|
1536
|
+
},
|
|
1537
|
+
{
|
|
1538
|
+
"name": "directUpdate",
|
|
1539
|
+
"tags": [
|
|
1540
|
+
{
|
|
1541
|
+
"text": "undefined",
|
|
1542
|
+
"name": "default"
|
|
1543
|
+
},
|
|
1544
|
+
{
|
|
1545
|
+
"text": "5.1.0",
|
|
1546
|
+
"name": "since"
|
|
1547
|
+
}
|
|
1548
|
+
],
|
|
1549
|
+
"docs": "Make the plugin direct install the update when the app what just updated/installed. Only for autoUpdate mode.\n\nOnly available for Android and iOS.",
|
|
1550
|
+
"complexTypes": [],
|
|
1551
|
+
"type": "boolean | undefined"
|
|
1477
1552
|
}
|
|
1478
1553
|
],
|
|
1479
1554
|
"docs": "These configuration values are available:"
|
|
@@ -86,6 +86,15 @@ declare module "@capacitor/cli" {
|
|
|
86
86
|
* @since 4.17.48
|
|
87
87
|
*/
|
|
88
88
|
version?: string;
|
|
89
|
+
/**
|
|
90
|
+
* Make the plugin direct install the update when the app what just updated/installed. Only for autoUpdate mode.
|
|
91
|
+
*
|
|
92
|
+
* Only available for Android and iOS.
|
|
93
|
+
*
|
|
94
|
+
* @default undefined
|
|
95
|
+
* @since 5.1.0
|
|
96
|
+
*/
|
|
97
|
+
directUpdate?: boolean;
|
|
89
98
|
};
|
|
90
99
|
}
|
|
91
100
|
}
|
|
@@ -213,6 +222,7 @@ export type DownloadCompleteListener = (state: DownloadCompleteEvent) => void;
|
|
|
213
222
|
export type MajorAvailableListener = (state: MajorAvailableEvent) => void;
|
|
214
223
|
export type UpdateFailedListener = (state: UpdateFailedEvent) => void;
|
|
215
224
|
export type AppReloadedListener = (state: void) => void;
|
|
225
|
+
export type AppReadyListener = (state: void) => void;
|
|
216
226
|
export interface CapacitorUpdaterPlugin {
|
|
217
227
|
/**
|
|
218
228
|
* Notify Capacitor Updater that the current bundle is working (a rollback will occur of this method is not called on every app launch)
|
|
@@ -417,6 +427,21 @@ export interface CapacitorUpdaterPlugin {
|
|
|
417
427
|
* @since 4.3.0
|
|
418
428
|
*/
|
|
419
429
|
addListener(eventName: "appReloaded", listenerFunc: AppReloadedListener): Promise<PluginListenerHandle> & PluginListenerHandle;
|
|
430
|
+
/**
|
|
431
|
+
* Listen for app ready event in the App, let you know when app is ready to use
|
|
432
|
+
*
|
|
433
|
+
* @since 5.1.0
|
|
434
|
+
*/
|
|
435
|
+
addListener(eventName: "appReady", listenerFunc: AppReadyListener): Promise<PluginListenerHandle> & PluginListenerHandle;
|
|
436
|
+
/**
|
|
437
|
+
* Get the native app version or the builtin version if set in config
|
|
438
|
+
*
|
|
439
|
+
* @returns {Promise<{ version: string }>} an Promise with version for this device
|
|
440
|
+
* @since 5.2.0
|
|
441
|
+
*/
|
|
442
|
+
getBuiltinVersion(): Promise<{
|
|
443
|
+
version: string;
|
|
444
|
+
}>;
|
|
420
445
|
/**
|
|
421
446
|
* Get unique ID used to identify device (sent to auto update server)
|
|
422
447
|
*
|
package/dist/esm/web.d.ts
CHANGED
package/dist/esm/web.js
CHANGED
|
@@ -32,6 +32,10 @@ export class CapacitorUpdaterWeb extends WebPlugin {
|
|
|
32
32
|
console.warn("Cannot get ID in web");
|
|
33
33
|
return { deviceId: "default" };
|
|
34
34
|
}
|
|
35
|
+
async getBuiltinVersion() {
|
|
36
|
+
console.warn("Cannot get version in web");
|
|
37
|
+
return { version: "default" };
|
|
38
|
+
}
|
|
35
39
|
async getPluginVersion() {
|
|
36
40
|
console.warn("Cannot get plugin version in web");
|
|
37
41
|
return { version: "default" };
|
package/dist/esm/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAa5C,MAAM,cAAc,GAAe;IACjC,MAAM,EAAE,SAAS;IACjB,OAAO,EAAE,EAAE;IACX,UAAU,EAAE,0BAA0B;IACtC,EAAE,EAAE,SAAS;IACb,QAAQ,EAAE,EAAE;CACb,CAAC;AAEF,MAAM,OAAO,mBACX,SAAQ,SAAS;IAGjB,KAAK,CAAC,QAAQ,CAAC,OAGd;QACC,OAAO,CAAC,IAAI,CAAC,gCAAgC,EAAE,OAAO,CAAC,CAAC;QACxD,OAAO,cAAc,CAAC;IACxB,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,OAAuB;QAChC,OAAO,CAAC,IAAI,CAAC,gCAAgC,EAAE,OAAO,CAAC,CAAC;QACxD,OAAO,cAAc,CAAC;IACxB,CAAC;IAED,KAAK,CAAC,mBAAmB;QACvB,OAAO,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC;QACtD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5B,CAAC;IACD,KAAK,CAAC,GAAG,CAAC,OAAuB;QAC/B,OAAO,CAAC,IAAI,CAAC,iCAAiC,EAAE,OAAO,CAAC,CAAC;QACzD,OAAO;IACT,CAAC;IACD,KAAK,CAAC,WAAW;QACf,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QACrC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IACjC,CAAC;IACD,KAAK,CAAC,gBAAgB;QACpB,OAAO,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;QACjD,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;IAChC,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,OAAuB;QA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,CAAC;IACJ,CAAC;IACD,KAAK,CAAC,UAAU,CAAC,OAA0B;QACzC,OAAO,CAAC,IAAI,CAAC,0BAA0B,EAAE,OAAO,CAAC,CAAC;QAClD,OAAO;YACL,MAAM,EAAE,OAAO;YACf,KAAK,EAAE,0BAA0B;SAClC,CAAC;IACJ,CAAC;IACD,KAAK,CAAC,WAAW,CAAC,OAA2B;QAC3C,OAAO,CAAC,IAAI,CAAC,2BAA2B,EAAE,OAAO,CAAC,CAAC;QACnD,OAAO;IACT,CAAC;IACD,KAAK,CAAC,UAAU;QACd,OAAO,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;QACzC,OAAO;YACL,MAAM,EAAE,OAAO;YACf,KAAK,EAAE,0BAA0B;SAClC,CAAC;IACJ,CAAC;IACD,KAAK,CAAC,cAAc;QAClB,OAAO,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;QAC/C,OAAO,cAAc,CAAC;IACxB,CAAC;IACD,KAAK,CAAC,aAAa,CAAC,OAEnB;QACC,OAAO,CAAC,IAAI,CAAC,6BAA6B,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,CAAC,CAAC;QACtE,OAAO;IACT,CAAC;IACD,KAAK,CAAC,QAAQ,CAAC,MAAsB;QACnC,OAAO,CAAC,IAAI,CAAC,wBAAwB,EAAE,MAAM,CAAC,CAAC;QAC/C,OAAO;IACT,CAAC;IACD,KAAK,CAAC,WAAW;QACf,OAAO,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;QAC1C,OAAO;IACT,CAAC;CACF"}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -44,6 +44,10 @@ class CapacitorUpdaterWeb extends core.WebPlugin {
|
|
|
44
44
|
console.warn("Cannot get ID in web");
|
|
45
45
|
return { deviceId: "default" };
|
|
46
46
|
}
|
|
47
|
+
async getBuiltinVersion() {
|
|
48
|
+
console.warn("Cannot get version in web");
|
|
49
|
+
return { version: "default" };
|
|
50
|
+
}
|
|
47
51
|
async getPluginVersion() {
|
|
48
52
|
console.warn("Cannot get plugin version in web");
|
|
49
53
|
return { version: "default" };
|
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nimport { registerPlugin } from \"@capacitor/core\";\nconst CapacitorUpdater = registerPlugin(\"CapacitorUpdater\", {\n web: () => import(\"./web\").then((m) => new m.CapacitorUpdaterWeb()),\n});\nexport * from \"./definitions\";\nexport { CapacitorUpdater };\n//# sourceMappingURL=index.js.map","/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nimport { WebPlugin } from \"@capacitor/core\";\nconst BUNDLE_BUILTIN = {\n status: \"success\",\n version: \"\",\n downloaded: \"1970-01-01T00:00:00.000Z\",\n id: \"builtin\",\n checksum: \"\",\n};\nexport class CapacitorUpdaterWeb extends WebPlugin {\n async download(options) {\n console.warn(\"Cannot download version in web\", options);\n return BUNDLE_BUILTIN;\n }\n async next(options) {\n console.warn(\"Cannot set next version in web\", options);\n return BUNDLE_BUILTIN;\n }\n async isAutoUpdateEnabled() {\n console.warn(\"Cannot get isAutoUpdateEnabled in web\");\n return { enabled: false };\n }\n async set(options) {\n console.warn(\"Cannot set active bundle in web\", options);\n return;\n }\n async getDeviceId() {\n console.warn(\"Cannot get ID in web\");\n return { deviceId: \"default\" };\n }\n async getPluginVersion() {\n console.warn(\"Cannot get plugin version in web\");\n return { version: \"default\" };\n }\n async delete(options) {\n console.warn(\"Cannot delete bundle in web\", options);\n }\n async list() {\n console.warn(\"Cannot list bundles in web\");\n return { bundles: [] };\n }\n async reset(options) {\n console.warn(\"Cannot reset version in web\", options);\n }\n async current() {\n console.warn(\"Cannot get current bundle in web\");\n return { bundle: BUNDLE_BUILTIN, native: \"0.0.0\" };\n }\n async reload() {\n console.warn(\"Cannot reload current bundle in web\");\n return;\n }\n async getLatest() {\n console.warn(\"Cannot getLatest current bundle in web\");\n return {\n version: \"0.0.0\",\n message: \"Cannot getLatest current bundle in web\",\n };\n }\n async setChannel(options) {\n console.warn(\"Cannot setChannel in web\", options);\n return {\n status: \"error\",\n error: \"Cannot setChannel in web\",\n };\n }\n async setCustomId(options) {\n console.warn(\"Cannot setCustomId in web\", options);\n return;\n }\n async getChannel() {\n console.warn(\"Cannot getChannel in web\");\n return {\n status: \"error\",\n error: \"Cannot getChannel in web\",\n };\n }\n async notifyAppReady() {\n console.warn(\"Cannot notify App Ready in web\");\n return BUNDLE_BUILTIN;\n }\n async setMultiDelay(options) {\n console.warn(\"Cannot setMultiDelay in web\", options === null || options === void 0 ? void 0 : options.delayConditions);\n return;\n }\n async setDelay(option) {\n console.warn(\"Cannot setDelay in web\", option);\n return;\n }\n async cancelDelay() {\n console.warn(\"Cannot cancelDelay in web\");\n return;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AAEK,MAAC,gBAAgB,GAAGA,mBAAc,CAAC,kBAAkB,EAAE;AAC5D,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,mBAAmB,EAAE,CAAC;AACvE,CAAC;;ACRD;AACA;AACA;AACA;AACA;AAEA,MAAM,cAAc,GAAG;AACvB,IAAI,MAAM,EAAE,SAAS;AACrB,IAAI,OAAO,EAAE,EAAE;AACf,IAAI,UAAU,EAAE,0BAA0B;AAC1C,IAAI,EAAE,EAAE,SAAS;AACjB,IAAI,QAAQ,EAAE,EAAE;AAChB,CAAC,CAAC;AACK,MAAM,mBAAmB,SAASC,cAAS,CAAC;AACnD,IAA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C,CAAC;AACvD,QAAQ,OAAO,cAAc,CAAC;AAC9B,KAAK;AACL,IAAI,MAAM,aAAa,CAAC,OAAO,EAAE;AACjC,QAAQ,OAAO,CAAC,IAAI,CAAC,6BAA6B,EAAE,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AAC/H,QAAQ,OAAO;AACf,KAAK;AACL,IAAI,MAAM,QAAQ,CAAC,MAAM,EAAE;AAC3B,QAAQ,OAAO,CAAC,IAAI,CAAC,wBAAwB,EAAE,MAAM,CAAC,CAAC;AACvD,QAAQ,OAAO;AACf,KAAK;AACL,IAAI,MAAM,WAAW,GAAG;AACxB,QAAQ,OAAO,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;AAClD,QAAQ,OAAO;AACf,KAAK;AACL;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nimport { registerPlugin } from \"@capacitor/core\";\nconst CapacitorUpdater = registerPlugin(\"CapacitorUpdater\", {\n web: () => import(\"./web\").then((m) => new m.CapacitorUpdaterWeb()),\n});\nexport * from \"./definitions\";\nexport { CapacitorUpdater };\n//# sourceMappingURL=index.js.map","/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nimport { WebPlugin } from \"@capacitor/core\";\nconst BUNDLE_BUILTIN = {\n status: \"success\",\n version: \"\",\n downloaded: \"1970-01-01T00:00:00.000Z\",\n id: \"builtin\",\n checksum: \"\",\n};\nexport class CapacitorUpdaterWeb extends WebPlugin {\n async download(options) {\n console.warn(\"Cannot download version in web\", options);\n return BUNDLE_BUILTIN;\n }\n async next(options) {\n console.warn(\"Cannot set next version in web\", options);\n return BUNDLE_BUILTIN;\n }\n async isAutoUpdateEnabled() {\n console.warn(\"Cannot get isAutoUpdateEnabled in web\");\n return { enabled: false };\n }\n async set(options) {\n console.warn(\"Cannot set active bundle in web\", options);\n return;\n }\n async getDeviceId() {\n console.warn(\"Cannot get ID in web\");\n return { deviceId: \"default\" };\n }\n async getBuiltinVersion() {\n console.warn(\"Cannot get version in web\");\n return { version: \"default\" };\n }\n async getPluginVersion() {\n console.warn(\"Cannot get plugin version in web\");\n return { version: \"default\" };\n }\n async delete(options) {\n console.warn(\"Cannot delete bundle in web\", options);\n }\n async list() {\n console.warn(\"Cannot list bundles in web\");\n return { bundles: [] };\n }\n async reset(options) {\n console.warn(\"Cannot reset version in web\", options);\n }\n async current() {\n console.warn(\"Cannot get current bundle in web\");\n return { bundle: BUNDLE_BUILTIN, native: \"0.0.0\" };\n }\n async reload() {\n console.warn(\"Cannot reload current bundle in web\");\n return;\n }\n async getLatest() {\n console.warn(\"Cannot getLatest current bundle in web\");\n return {\n version: \"0.0.0\",\n message: \"Cannot getLatest current bundle in web\",\n };\n }\n async setChannel(options) {\n console.warn(\"Cannot setChannel in web\", options);\n return {\n status: \"error\",\n error: \"Cannot setChannel in web\",\n };\n }\n async setCustomId(options) {\n console.warn(\"Cannot setCustomId in web\", options);\n return;\n }\n async getChannel() {\n console.warn(\"Cannot getChannel in web\");\n return {\n status: \"error\",\n error: \"Cannot getChannel in web\",\n };\n }\n async notifyAppReady() {\n console.warn(\"Cannot notify App Ready in web\");\n return BUNDLE_BUILTIN;\n }\n async setMultiDelay(options) {\n console.warn(\"Cannot setMultiDelay in web\", options === null || options === void 0 ? void 0 : options.delayConditions);\n return;\n }\n async setDelay(option) {\n console.warn(\"Cannot setDelay in web\", option);\n return;\n }\n async cancelDelay() {\n console.warn(\"Cannot cancelDelay in web\");\n return;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin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-43,6 +43,10 @@ var capacitorCapacitorUpdater = (function (exports, core) {
|
|
|
43
43
|
console.warn("Cannot get ID in web");
|
|
44
44
|
return { deviceId: "default" };
|
|
45
45
|
}
|
|
46
|
+
async getBuiltinVersion() {
|
|
47
|
+
console.warn("Cannot get version in web");
|
|
48
|
+
return { version: "default" };
|
|
49
|
+
}
|
|
46
50
|
async getPluginVersion() {
|
|
47
51
|
console.warn("Cannot get plugin version in web");
|
|
48
52
|
return { version: "default" };
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nimport { registerPlugin } from \"@capacitor/core\";\nconst CapacitorUpdater = registerPlugin(\"CapacitorUpdater\", {\n web: () => import(\"./web\").then((m) => new m.CapacitorUpdaterWeb()),\n});\nexport * from \"./definitions\";\nexport { CapacitorUpdater };\n//# sourceMappingURL=index.js.map","/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nimport { WebPlugin } from \"@capacitor/core\";\nconst BUNDLE_BUILTIN = {\n status: \"success\",\n version: \"\",\n downloaded: \"1970-01-01T00:00:00.000Z\",\n id: \"builtin\",\n checksum: \"\",\n};\nexport class CapacitorUpdaterWeb extends WebPlugin {\n async download(options) {\n console.warn(\"Cannot download version in web\", options);\n return BUNDLE_BUILTIN;\n }\n async next(options) {\n console.warn(\"Cannot set next version in web\", options);\n return BUNDLE_BUILTIN;\n }\n async isAutoUpdateEnabled() {\n console.warn(\"Cannot get isAutoUpdateEnabled in web\");\n return { enabled: false };\n }\n async set(options) {\n console.warn(\"Cannot set active bundle in web\", options);\n return;\n }\n async getDeviceId() {\n console.warn(\"Cannot get ID in web\");\n return { deviceId: \"default\" };\n }\n async getPluginVersion() {\n console.warn(\"Cannot get plugin version in web\");\n return { version: \"default\" };\n }\n async delete(options) {\n console.warn(\"Cannot delete bundle in web\", options);\n }\n async list() {\n console.warn(\"Cannot list bundles in web\");\n return { bundles: [] };\n }\n async reset(options) {\n console.warn(\"Cannot reset version in web\", options);\n }\n async current() {\n console.warn(\"Cannot get current bundle in web\");\n return { bundle: BUNDLE_BUILTIN, native: \"0.0.0\" };\n }\n async reload() {\n console.warn(\"Cannot reload current bundle in web\");\n return;\n }\n async getLatest() {\n console.warn(\"Cannot getLatest current bundle in web\");\n return {\n version: \"0.0.0\",\n message: \"Cannot getLatest current bundle in web\",\n };\n }\n async setChannel(options) {\n console.warn(\"Cannot setChannel in web\", options);\n return {\n status: \"error\",\n error: \"Cannot setChannel in web\",\n };\n }\n async setCustomId(options) {\n console.warn(\"Cannot setCustomId in web\", options);\n return;\n }\n async getChannel() {\n console.warn(\"Cannot getChannel in web\");\n return {\n status: \"error\",\n error: \"Cannot getChannel in web\",\n };\n }\n async notifyAppReady() {\n console.warn(\"Cannot notify App Ready in web\");\n return BUNDLE_BUILTIN;\n }\n async setMultiDelay(options) {\n console.warn(\"Cannot setMultiDelay in web\", options === null || options === void 0 ? void 0 : options.delayConditions);\n return;\n }\n async setDelay(option) {\n console.warn(\"Cannot setDelay in web\", option);\n return;\n }\n async cancelDelay() {\n console.warn(\"Cannot cancelDelay in web\");\n return;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;IAAA;IACA;IACA;IACA;IACA;AAEK,UAAC,gBAAgB,GAAGA,mBAAc,CAAC,kBAAkB,EAAE;IAC5D,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,mBAAmB,EAAE,CAAC;IACvE,CAAC;;ICRD;IACA;IACA;IACA;IACA;IAEA,MAAM,cAAc,GAAG;IACvB,IAA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AA0B,CAAC,CAAC;IACjD,QAAQ,OAAO;IACf,YAAY,MAAM,EAAE,OAAO;IAC3B,YAAY,KAAK,EAAE,0BAA0B;IAC7C,SAAS,CAAC;IACV,KAAK;IACL,IAAI,MAAM,cAAc,GAAG;IAC3B,QAAQ,OAAO,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;IACvD,QAAQ,OAAO,cAAc,CAAC;IAC9B,KAAK;IACL,IAAI,MAAM,aAAa,CAAC,OAAO,EAAE;IACjC,QAAQ,OAAO,CAAC,IAAI,CAAC,6BAA6B,EAAE,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAC/H,QAAQ,OAAO;IACf,KAAK;IACL,IAAI,MAAM,QAAQ,CAAC,MAAM,EAAE;IAC3B,QAAQ,OAAO,CAAC,IAAI,CAAC,wBAAwB,EAAE,MAAM,CAAC,CAAC;IACvD,QAAQ,OAAO;IACf,KAAK;IACL,IAAI,MAAM,WAAW,GAAG;IACxB,QAAQ,OAAO,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;IAClD,QAAQ,OAAO;IACf,KAAK;IACL;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nimport { registerPlugin } from \"@capacitor/core\";\nconst CapacitorUpdater = registerPlugin(\"CapacitorUpdater\", {\n web: () => import(\"./web\").then((m) => new m.CapacitorUpdaterWeb()),\n});\nexport * from \"./definitions\";\nexport { CapacitorUpdater };\n//# sourceMappingURL=index.js.map","/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nimport { WebPlugin } from \"@capacitor/core\";\nconst BUNDLE_BUILTIN = {\n status: \"success\",\n version: \"\",\n downloaded: \"1970-01-01T00:00:00.000Z\",\n id: \"builtin\",\n checksum: \"\",\n};\nexport class CapacitorUpdaterWeb extends WebPlugin {\n async download(options) {\n console.warn(\"Cannot download version in web\", options);\n return BUNDLE_BUILTIN;\n }\n async next(options) {\n console.warn(\"Cannot set next version in web\", options);\n return BUNDLE_BUILTIN;\n }\n async isAutoUpdateEnabled() {\n console.warn(\"Cannot get isAutoUpdateEnabled in web\");\n return { enabled: false };\n }\n async set(options) {\n console.warn(\"Cannot set active bundle in web\", options);\n return;\n }\n async getDeviceId() {\n console.warn(\"Cannot get ID in web\");\n return { deviceId: \"default\" };\n }\n async getBuiltinVersion() {\n console.warn(\"Cannot get version in web\");\n return { version: \"default\" };\n }\n async getPluginVersion() {\n console.warn(\"Cannot get plugin version in web\");\n return { version: \"default\" };\n }\n async delete(options) {\n console.warn(\"Cannot delete bundle in web\", options);\n }\n async list() {\n console.warn(\"Cannot list bundles in web\");\n return { bundles: [] };\n }\n async reset(options) {\n console.warn(\"Cannot reset version in web\", options);\n }\n async current() {\n console.warn(\"Cannot get current bundle in web\");\n return { bundle: BUNDLE_BUILTIN, native: \"0.0.0\" };\n }\n async reload() {\n console.warn(\"Cannot reload current bundle in web\");\n return;\n }\n async getLatest() {\n console.warn(\"Cannot getLatest current bundle in web\");\n return {\n version: \"0.0.0\",\n message: \"Cannot getLatest current bundle in web\",\n };\n }\n async setChannel(options) {\n console.warn(\"Cannot setChannel in web\", options);\n return {\n status: \"error\",\n error: \"Cannot setChannel in web\",\n };\n }\n async setCustomId(options) {\n console.warn(\"Cannot setCustomId in web\", options);\n return;\n }\n async getChannel() {\n console.warn(\"Cannot getChannel in web\");\n return {\n status: \"error\",\n error: \"Cannot getChannel in web\",\n };\n }\n async notifyAppReady() {\n console.warn(\"Cannot notify App Ready in web\");\n return BUNDLE_BUILTIN;\n }\n async setMultiDelay(options) {\n console.warn(\"Cannot setMultiDelay in web\", options === null || options === void 0 ? void 0 : options.delayConditions);\n return;\n }\n async setDelay(option) {\n console.warn(\"Cannot setDelay in web\", option);\n return;\n }\n async cancelDelay() {\n console.warn(\"Cannot cancelDelay in web\");\n return;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;IAAA;IACA;IACA;IACA;IACA;AAEK,UAAC,gBAAgB,GAAGA,mBAAc,CAAC,kBAAkB,EAAE;IAC5D,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,mBAAmB,EAAE,CAAC;IACvE,CAAC;;ICRD;IACA;IACA;IACA;IACA;IAEA,MAAM,cAAc,GAAG;IACvB,IAAI,MAAM,EAAE,SAAS;IACrB,IAAI,OAAO,EAAE,EAAE;IACf,IAAI,UAAU,EAAE,0BAA0B;IAC1C,IAAI,EAAE,EAAE,SAAS;IACjB,IAAI,QAAQ,EAAE,EAAE;IAChB,CAAC,CAAC;IACK,MAAM,mBAAmB,SAASC,cAAS,CAAC;IACnD,IAAI,MAAM,QAAQ,CAAC,OAAO,EAAE;IAC5B,QAAQ,OAAO,CAAC,IAAI,CAAC,gCAAgC,EAAE,OAAO,CAAC,CAAC;IAChE,QAAQ,OAAO,cAAc,CAAC;IAC9B,KAAK;IACL,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;IACxB,QAAQ,OAAO,CAAC,IAAI,CAAC,gCAAgC,EAAE,OAAO,CAAC,CAAC;IAChE,QAAQ,OAAO,cAAc,CAAC;IAC9B,KAAK;IACL,IAAI,MAAM,mBAAmB,GAAG;IAChC,QAAQ,OAAO,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC;IAC9D,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAClC,KAAK;IACL,IAAI,MAAM,GAAG,CAAC,OAAO,EAAE;IACvB,QAAQ,OAAO,CAAC,IAAI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AAM,CAAC,CAAC;IACvD,QAAQ,OAAO;IACf,KAAK;IACL,IAAI,MAAM,WAAW,GAAG;IACxB,QAAQ,OAAO,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;IAClD,QAAQ,OAAO;IACf,KAAK;IACL;;;;;;;;;;;;;;;"}
|
|
@@ -232,7 +232,7 @@ extension CustomError: LocalizedError {
|
|
|
232
232
|
|
|
233
233
|
public let TAG: String = "✨ Capacitor-updater:"
|
|
234
234
|
public let CAP_SERVER_PATH: String = "serverBasePath"
|
|
235
|
-
public var
|
|
235
|
+
public var versionBuild: String = ""
|
|
236
236
|
public var customId: String = ""
|
|
237
237
|
public var PLUGIN_VERSION: String = ""
|
|
238
238
|
public let timeout: Double = 20
|
|
@@ -395,7 +395,7 @@ extension CustomError: LocalizedError {
|
|
|
395
395
|
device_id: self.deviceID,
|
|
396
396
|
app_id: self.appId,
|
|
397
397
|
custom_id: self.customId,
|
|
398
|
-
version_build: self.
|
|
398
|
+
version_build: self.versionBuild,
|
|
399
399
|
version_code: self.versionCode,
|
|
400
400
|
version_os: self.versionOs,
|
|
401
401
|
version_name: self.getCurrentBundle().getVersionName(),
|
|
@@ -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 = "5.
|
|
18
|
+
private let PLUGIN_VERSION: String = "5.2.2"
|
|
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"
|
|
@@ -29,6 +29,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
|
|
|
29
29
|
private var appReadyTimeout = 10000
|
|
30
30
|
private var appReadyCheck: DispatchWorkItem?
|
|
31
31
|
private var resetWhenUpdate = true
|
|
32
|
+
private var directUpdate = false
|
|
32
33
|
private var autoDeleteFailed = false
|
|
33
34
|
private var autoDeletePrevious = false
|
|
34
35
|
private var backgroundWork: DispatchWorkItem?
|
|
@@ -42,9 +43,10 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
|
|
|
42
43
|
print("\(self.implementation.TAG) Cannot get version native \(currentVersionNative)")
|
|
43
44
|
}
|
|
44
45
|
print("\(self.implementation.TAG) version native \(self.currentVersionNative.description)")
|
|
45
|
-
implementation.
|
|
46
|
+
implementation.versionBuild = getConfig().getString("version", Bundle.main.versionName)!
|
|
46
47
|
autoDeleteFailed = getConfig().getBoolean("autoDeleteFailed", true)
|
|
47
48
|
autoDeletePrevious = getConfig().getBoolean("autoDeletePrevious", true)
|
|
49
|
+
directUpdate = getConfig().getBoolean("directUpdate", false)
|
|
48
50
|
updateUrl = getConfig().getString("updateUrl", CapacitorUpdaterPlugin.updateUrlDefault)!
|
|
49
51
|
autoUpdate = getConfig().getBoolean("autoUpdate", true)
|
|
50
52
|
appReadyTimeout = getConfig().getInt("appReadyTimeout", 10000)
|
|
@@ -102,6 +104,10 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
|
|
|
102
104
|
}
|
|
103
105
|
}
|
|
104
106
|
|
|
107
|
+
@objc func getBuiltinVersion(_ call: CAPPluginCall) {
|
|
108
|
+
call.resolve(["version": implementation.versionBuild])
|
|
109
|
+
}
|
|
110
|
+
|
|
105
111
|
@objc func getDeviceId(_ call: CAPPluginCall) {
|
|
106
112
|
call.resolve(["deviceId": implementation.deviceID])
|
|
107
113
|
}
|
|
@@ -522,34 +528,34 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
|
|
|
522
528
|
let latestVersionName = res.version
|
|
523
529
|
if latestVersionName != "" && current.getVersionName() != latestVersionName {
|
|
524
530
|
let latest = self.implementation.getBundleInfoByVersionName(version: latestVersionName)
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
531
|
+
do {
|
|
532
|
+
print("\(self.implementation.TAG) New bundle: \(latestVersionName) found. Current is: \(current.getVersionName()). Update will occur next time app moves to background.")
|
|
533
|
+
var nextImpl = self.implementation.getBundleInfoByVersionName(version: latestVersionName)
|
|
534
|
+
if nextImpl == nil || ((nextImpl?.isDeleted()) != nil) {
|
|
535
|
+
if (nextImpl?.isDeleted()) != nil {
|
|
536
|
+
print("\(self.implementation.TAG) Latest bundle already exists and will be deleted, download will overwrite it.")
|
|
537
|
+
let res = self.implementation.delete(id: nextImpl!.getId(), removeInfo: true)
|
|
538
|
+
if res {
|
|
539
|
+
print("\(self.implementation.TAG) Delete version deleted: \(nextImpl!.toString())")
|
|
540
|
+
} else {
|
|
541
|
+
print("\(self.implementation.TAG) Failed to delete failed bundle: \(nextImpl!.toString())")
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
nextImpl = try self.implementation.download(url: downloadUrl, version: latestVersionName, sessionKey: sessionKey)
|
|
545
|
+
}
|
|
546
|
+
guard let next = nextImpl else {
|
|
547
|
+
print("\(self.implementation.TAG) Error downloading file")
|
|
548
|
+
self.notifyListeners("downloadFailed", data: ["version": latestVersionName])
|
|
528
549
|
self.notifyListeners("noNeedUpdate", data: ["bundle": current.toJSON()])
|
|
529
550
|
self.endBackGroundTask()
|
|
530
551
|
return
|
|
531
552
|
}
|
|
532
|
-
if
|
|
533
|
-
print("\(self.implementation.TAG) Latest version
|
|
534
|
-
self.notifyListeners("
|
|
535
|
-
_ = self.implementation.setNextBundle(next: latest!.getId())
|
|
553
|
+
if next.isErrorStatus() {
|
|
554
|
+
print("\(self.implementation.TAG) Latest version is in error state. Aborting update.")
|
|
555
|
+
self.notifyListeners("noNeedUpdate", data: ["bundle": current.toJSON()])
|
|
536
556
|
self.endBackGroundTask()
|
|
537
557
|
return
|
|
538
558
|
}
|
|
539
|
-
if latest!.isDeleted() {
|
|
540
|
-
print("\(self.implementation.TAG) Latest bundle already exists and will be deleted, download will overwrite it.")
|
|
541
|
-
let res = self.implementation.delete(id: latest!.getId(), removeInfo: true)
|
|
542
|
-
if !res {
|
|
543
|
-
print("\(self.implementation.TAG) Delete version deleted: \(latest!.toString())")
|
|
544
|
-
} else {
|
|
545
|
-
print("\(self.implementation.TAG) Failed to delete failed bundle: \(latest!.toString())")
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
do {
|
|
551
|
-
print("\(self.implementation.TAG) New bundle: \(latestVersionName) found. Current is: \(current.getVersionName()). Update will occur next time app moves to background.")
|
|
552
|
-
let next = try self.implementation.download(url: downloadUrl, version: latestVersionName, sessionKey: sessionKey)
|
|
553
559
|
if res.checksum != "" && next.getChecksum() != res.checksum {
|
|
554
560
|
print("\(self.implementation.TAG) Error checksum", next.getChecksum(), res.checksum)
|
|
555
561
|
self.implementation.sendStats(action: "checksum_fail", versionName: next.getVersionName())
|
|
@@ -558,11 +564,15 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
|
|
|
558
564
|
if !resDel {
|
|
559
565
|
print("\(self.implementation.TAG) Delete failed, id \(id) doesn't exist")
|
|
560
566
|
}
|
|
561
|
-
self.endBackGroundTask()
|
|
562
567
|
throw ObjectSavableError.checksum
|
|
563
568
|
}
|
|
564
|
-
self.
|
|
565
|
-
|
|
569
|
+
if self.directUpdate {
|
|
570
|
+
self.implementation.set(bundle: next)
|
|
571
|
+
self._reload()
|
|
572
|
+
} else {
|
|
573
|
+
self.notifyListeners("updateAvailable", data: ["bundle": next.toJSON()])
|
|
574
|
+
_ = self.implementation.setNextBundle(next: next.getId())
|
|
575
|
+
}
|
|
566
576
|
} catch {
|
|
567
577
|
print("\(self.implementation.TAG) Error downloading file", error.localizedDescription)
|
|
568
578
|
let current: BundleInfo = self.implementation.getCurrentBundle()
|
|
@@ -574,6 +584,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
|
|
|
574
584
|
print("\(self.implementation.TAG) No need to update, \(current.getId()) is the latest bundle.")
|
|
575
585
|
self.notifyListeners("noNeedUpdate", data: ["bundle": current.toJSON()])
|
|
576
586
|
}
|
|
587
|
+
self.notifyListeners("appReady", data: ["bundle": current.toJSON()])
|
|
577
588
|
self.endBackGroundTask()
|
|
578
589
|
}
|
|
579
590
|
}
|