@capgo/capacitor-updater 5.2.35 → 5.3.3

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 CHANGED
@@ -133,6 +133,7 @@ Capacitor Updator works by unzipping a compiled app bundle to the native device
133
133
  * [`cancelDelay()`](#canceldelay)
134
134
  * [`getLatest()`](#getlatest)
135
135
  * [`setChannel(...)`](#setchannel)
136
+ * [`unsetChannel(...)`](#unsetchannel)
136
137
  * [`getChannel()`](#getchannel)
137
138
  * [`setCustomId(...)`](#setcustomid)
138
139
  * [`addListener('download', ...)`](#addlistenerdownload)
@@ -352,6 +353,23 @@ Set Channel for this device, the channel have to allow self assignement to make
352
353
  --------------------
353
354
 
354
355
 
356
+ ### unsetChannel(...)
357
+
358
+ ```typescript
359
+ unsetChannel(options: UnsetChannelOptions) => Promise<void>
360
+ ```
361
+
362
+ Unset Channel for this device, the device will return to the default channel
363
+
364
+ | Param | Type |
365
+ | ------------- | ------------------------------------------------------------------- |
366
+ | **`options`** | <code><a href="#unsetchanneloptions">UnsetChannelOptions</a></code> |
367
+
368
+ **Since:** 4.7.0
369
+
370
+ --------------------
371
+
372
+
355
373
  ### getChannel()
356
374
 
357
375
  ```typescript
@@ -390,7 +408,7 @@ Set Channel for this device
390
408
  addListener(eventName: "download", listenerFunc: DownloadChangeListener) => Promise<PluginListenerHandle> & PluginListenerHandle
391
409
  ```
392
410
 
393
- Listen for download event in the App, let you know when the download is started, loading and finished
411
+ Listen for download event in the App, let you know when the download is started, loading and finished, with a percent value
394
412
 
395
413
  | Param | Type |
396
414
  | ------------------ | ------------------------------------------------------------------------- |
@@ -683,6 +701,13 @@ Remove all listeners for this plugin.
683
701
  | **`triggerAutoUpdate`** | <code>boolean</code> |
684
702
 
685
703
 
704
+ #### UnsetChannelOptions
705
+
706
+ | Prop | Type |
707
+ | ----------------------- | -------------------- |
708
+ | **`triggerAutoUpdate`** | <code>boolean</code> |
709
+
710
+
686
711
  #### getChannelRes
687
712
 
688
713
  | Prop | Type | Description | Since |
@@ -70,7 +70,6 @@ public class CapacitorUpdater {
70
70
  private static final String bundleDirectory = "versions";
71
71
 
72
72
  public static final String TAG = "Capacitor-updater";
73
- public static final int timeout = 20000;
74
73
 
75
74
  public SharedPreferences.Editor editor;
76
75
  public SharedPreferences prefs;
@@ -91,6 +90,7 @@ public class CapacitorUpdater {
91
90
  public String appId = "";
92
91
  public String privateKey = "";
93
92
  public String deviceID = "";
93
+ public int timeout = 20000;
94
94
 
95
95
  private final FilenameFilter filter = new FilenameFilter() {
96
96
  @Override
@@ -748,6 +748,17 @@ public class CapacitorUpdater {
748
748
  return json;
749
749
  }
750
750
 
751
+ private JsonObjectRequest setRetryPolicy(JsonObjectRequest request) {
752
+ request.setRetryPolicy(
753
+ new DefaultRetryPolicy(
754
+ this.timeout,
755
+ DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
756
+ DefaultRetryPolicy.DEFAULT_BACKOFF_MULT
757
+ )
758
+ );
759
+ return request;
760
+ }
761
+
751
762
  private JSObject createError(String message, VolleyError error) {
752
763
  NetworkResponse response = error.networkResponse;
753
764
  final JSObject retError = new JSObject();
@@ -824,14 +835,74 @@ public class CapacitorUpdater {
824
835
  }
825
836
  }
826
837
  );
827
- request.setRetryPolicy(
828
- new DefaultRetryPolicy(
829
- this.timeout,
830
- DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
831
- DefaultRetryPolicy.DEFAULT_BACKOFF_MULT
832
- )
838
+ this.requestQueue.add(setRetryPolicy(request));
839
+ }
840
+
841
+ public void unsetChannel(final Callback callback) {
842
+ String channelUrl = this.channelUrl;
843
+ if (
844
+ channelUrl == null || "".equals(channelUrl) || channelUrl.length() == 0
845
+ ) {
846
+ Log.e(TAG, "Channel URL is not set");
847
+ final JSObject retError = new JSObject();
848
+ retError.put("message", "channelUrl missing");
849
+ retError.put("error", "missing_config");
850
+ callback.callback(retError);
851
+ return;
852
+ }
853
+ JSONObject json = null;
854
+ try {
855
+ json = this.createInfoObject();
856
+ } catch (JSONException e) {
857
+ Log.e(TAG, "Error unsetChannel JSONException", e);
858
+ e.printStackTrace();
859
+ final JSObject retError = new JSObject();
860
+ retError.put("message", "Cannot get info: " + e.toString());
861
+ retError.put("error", "json_error");
862
+ callback.callback(retError);
863
+ return;
864
+ }
865
+ // Building a request
866
+ JsonObjectRequest request = new JsonObjectRequest(
867
+ Request.Method.DELETE,
868
+ channelUrl,
869
+ json,
870
+ new Response.Listener<JSONObject>() {
871
+ @Override
872
+ public void onResponse(JSONObject res) {
873
+ final JSObject ret = new JSObject();
874
+ Iterator<String> keys = res.keys();
875
+ while (keys.hasNext()) {
876
+ String key = keys.next();
877
+ if (res.has(key)) {
878
+ try {
879
+ ret.put(key, res.get(key));
880
+ } catch (JSONException e) {
881
+ e.printStackTrace();
882
+ final JSObject retError = new JSObject();
883
+ retError.put(
884
+ "message",
885
+ "Cannot unset channel: " + e.toString()
886
+ );
887
+ retError.put("error", "response_error");
888
+ callback.callback(ret);
889
+ }
890
+ }
891
+ }
892
+ Log.i(TAG, "Channel unset");
893
+ callback.callback(ret);
894
+ }
895
+ },
896
+ new Response.ErrorListener() {
897
+ @Override
898
+ public void onErrorResponse(VolleyError error) {
899
+ callback.callback(
900
+ CapacitorUpdater.this.createError("Error unset channel", error)
901
+ );
902
+ }
903
+ }
833
904
  );
834
- this.requestQueue.add(request);
905
+ this.requestQueue.add(setRetryPolicy(request));
835
906
  }
836
907
 
837
908
  public void setChannel(final String channel, final Callback callback) {
@@ -896,14 +967,7 @@ public class CapacitorUpdater {
896
967
  }
897
968
  }
898
969
  );
899
- request.setRetryPolicy(
900
- new DefaultRetryPolicy(
901
- this.timeout,
902
- DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
903
- DefaultRetryPolicy.DEFAULT_BACKOFF_MULT
904
- )
905
- );
906
- this.requestQueue.add(request);
970
+ this.requestQueue.add(setRetryPolicy(request));
907
971
  }
908
972
 
909
973
  public void getChannel(final Callback callback) {
@@ -963,14 +1027,7 @@ public class CapacitorUpdater {
963
1027
  }
964
1028
  }
965
1029
  );
966
- request.setRetryPolicy(
967
- new DefaultRetryPolicy(
968
- this.timeout,
969
- DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
970
- DefaultRetryPolicy.DEFAULT_BACKOFF_MULT
971
- )
972
- );
973
- this.requestQueue.add(request);
1030
+ this.requestQueue.add(setRetryPolicy(request));
974
1031
  }
975
1032
 
976
1033
  public void sendStats(final String action, final String versionName) {
@@ -1008,14 +1065,7 @@ public class CapacitorUpdater {
1008
1065
  }
1009
1066
  }
1010
1067
  );
1011
- request.setRetryPolicy(
1012
- new DefaultRetryPolicy(
1013
- this.timeout,
1014
- DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
1015
- DefaultRetryPolicy.DEFAULT_BACKOFF_MULT
1016
- )
1017
- );
1018
- this.requestQueue.add(request);
1068
+ this.requestQueue.add(setRetryPolicy(request));
1019
1069
  }
1020
1070
 
1021
1071
  public BundleInfo getBundleInfo(final String id) {
@@ -58,7 +58,7 @@ public class CapacitorUpdaterPlugin extends Plugin {
58
58
  private static final String channelUrlDefault =
59
59
  "https://api.capgo.app/channel_self";
60
60
 
61
- private final String PLUGIN_VERSION = "5.2.35";
61
+ private final String PLUGIN_VERSION = "5.3.3";
62
62
  private static final String DELAY_CONDITION_PREFERENCES = "";
63
63
 
64
64
  private SharedPreferences.Editor editor;
@@ -161,6 +161,12 @@ public class CapacitorUpdaterPlugin extends Plugin {
161
161
 
162
162
  final CapConfig config = CapConfig.loadDefault(this.getActivity());
163
163
  this.implementation.appId = config.getString("appId", "");
164
+ this.implementation.appId =
165
+ this.getConfig().getString("appId", this.implementation.appId);
166
+ if (!"".equals(implementation.appId)) {
167
+ Log.i(CapacitorUpdater.TAG, "appId: " + implementation.appId);
168
+ throw new RuntimeException("appId is required");
169
+ }
164
170
  this.implementation.privateKey =
165
171
  this.getConfig().getString("privateKey", defaultPrivateKey);
166
172
  this.implementation.statsUrl =
@@ -189,6 +195,8 @@ public class CapacitorUpdaterPlugin extends Plugin {
189
195
  this.updateUrl = this.getConfig().getString("updateUrl", updateUrlDefault);
190
196
  this.autoUpdate = this.getConfig().getBoolean("autoUpdate", true);
191
197
  this.appReadyTimeout = this.getConfig().getInt("appReadyTimeout", 10000);
198
+ this.implementation.timeout =
199
+ this.getConfig().getInt("responseTimeout", 20) * 1000;
192
200
  this.resetWhenUpdate = this.getConfig().getBoolean("resetWhenUpdate", true);
193
201
 
194
202
  if (this.resetWhenUpdate) {
@@ -385,6 +393,43 @@ public class CapacitorUpdaterPlugin extends Plugin {
385
393
  }
386
394
  }
387
395
 
396
+ @PluginMethod
397
+ public void unsetChannel(final PluginCall call) {
398
+ final Boolean triggerAutoUpdate = call.getBoolean(
399
+ "triggerAutoUpdate",
400
+ false
401
+ );
402
+
403
+ try {
404
+ Log.i(
405
+ CapacitorUpdater.TAG,
406
+ "unsetChannel triggerAutoUpdate: " + triggerAutoUpdate
407
+ );
408
+ startNewThread(() -> {
409
+ CapacitorUpdaterPlugin.this.implementation.unsetChannel(res -> {
410
+ if (res.has("error")) {
411
+ call.reject(res.getString("error"));
412
+ } else {
413
+ if (
414
+ CapacitorUpdaterPlugin.this._isAutoUpdateEnabled() &&
415
+ triggerAutoUpdate
416
+ ) {
417
+ Log.i(
418
+ CapacitorUpdater.TAG,
419
+ "Calling autoupdater after channel change!"
420
+ );
421
+ backgroundDownload();
422
+ }
423
+ call.resolve(res);
424
+ }
425
+ });
426
+ });
427
+ } catch (final Exception e) {
428
+ Log.e(CapacitorUpdater.TAG, "Failed to unsetChannel: ", e);
429
+ call.reject("Failed to unsetChannel: ", e);
430
+ }
431
+ }
432
+
388
433
  @PluginMethod
389
434
  public void setChannel(final PluginCall call) {
390
435
  final String channel = call.getString("channel");
package/dist/docs.json CHANGED
@@ -371,6 +371,37 @@
371
371
  ],
372
372
  "slug": "setchannel"
373
373
  },
374
+ {
375
+ "name": "unsetChannel",
376
+ "signature": "(options: UnsetChannelOptions) => Promise<void>",
377
+ "parameters": [
378
+ {
379
+ "name": "options",
380
+ "docs": "",
381
+ "type": "UnsetChannelOptions"
382
+ }
383
+ ],
384
+ "returns": "Promise<void>",
385
+ "tags": [
386
+ {
387
+ "name": "returns",
388
+ "text": "an Promise resolved when channel is set"
389
+ },
390
+ {
391
+ "name": "throws",
392
+ "text": "An error if the something went wrong"
393
+ },
394
+ {
395
+ "name": "since",
396
+ "text": "4.7.0"
397
+ }
398
+ ],
399
+ "docs": "Unset Channel for this device, the device will return to the default channel",
400
+ "complexTypes": [
401
+ "UnsetChannelOptions"
402
+ ],
403
+ "slug": "unsetchannel"
404
+ },
374
405
  {
375
406
  "name": "getChannel",
376
407
  "signature": "() => Promise<getChannelRes>",
@@ -453,7 +484,7 @@
453
484
  "text": "2.0.11"
454
485
  }
455
486
  ],
456
- "docs": "Listen for download event in the App, let you know when the download is started, loading and finished",
487
+ "docs": "Listen for download event in the App, let you know when the download is started, loading and finished, with a percent value",
457
488
  "complexTypes": [
458
489
  "PluginListenerHandle",
459
490
  "DownloadChangeListener"
@@ -988,6 +1019,22 @@
988
1019
  }
989
1020
  ]
990
1021
  },
1022
+ {
1023
+ "name": "UnsetChannelOptions",
1024
+ "slug": "unsetchanneloptions",
1025
+ "docs": "",
1026
+ "tags": [],
1027
+ "methods": [],
1028
+ "properties": [
1029
+ {
1030
+ "name": "triggerAutoUpdate",
1031
+ "tags": [],
1032
+ "docs": "",
1033
+ "complexTypes": [],
1034
+ "type": "boolean | undefined"
1035
+ }
1036
+ ]
1037
+ },
991
1038
  {
992
1039
  "name": "getChannelRes",
993
1040
  "slug": "getchannelres",
@@ -1449,6 +1496,22 @@
1449
1496
  "complexTypes": [],
1450
1497
  "type": "number | undefined"
1451
1498
  },
1499
+ {
1500
+ "name": "responseTimeout",
1501
+ "tags": [
1502
+ {
1503
+ "text": "20 // (20 second)",
1504
+ "name": "default"
1505
+ },
1506
+ {
1507
+ "text": "10 // (10 second)",
1508
+ "name": "example"
1509
+ }
1510
+ ],
1511
+ "docs": "Configure the number of milliseconds the native plugin should wait before considering API timeout.\n\nOnly available for Android and iOS.",
1512
+ "complexTypes": [],
1513
+ "type": "number | undefined"
1514
+ },
1452
1515
  {
1453
1516
  "name": "autoDeleteFailed",
1454
1517
  "tags": [
@@ -14,6 +14,15 @@ declare module "@capacitor/cli" {
14
14
  * @example 1000 // (1 second)
15
15
  */
16
16
  appReadyTimeout?: number;
17
+ /**
18
+ * Configure the number of milliseconds the native plugin should wait before considering API timeout.
19
+ *
20
+ * Only available for Android and iOS.
21
+ *
22
+ * @default 20 // (20 second)
23
+ * @example 10 // (10 second)
24
+ */
25
+ responseTimeout?: number;
17
26
  /**
18
27
  * Configure whether the plugin should use automatically delete failed bundles.
19
28
  *
@@ -211,6 +220,9 @@ export interface SetChannelOptions {
211
220
  channel: string;
212
221
  triggerAutoUpdate?: boolean;
213
222
  }
223
+ export interface UnsetChannelOptions {
224
+ triggerAutoUpdate?: boolean;
225
+ }
214
226
  export interface SetCustomIdOptions {
215
227
  customId: string;
216
228
  }
@@ -374,6 +386,14 @@ export interface CapacitorUpdaterPlugin {
374
386
  * @since 4.7.0
375
387
  */
376
388
  setChannel(options: SetChannelOptions): Promise<channelRes>;
389
+ /**
390
+ * Unset Channel for this device, the device will return to the default channel
391
+ *
392
+ * @returns {Promise<channelRes>} an Promise resolved when channel is set
393
+ * @throws An error if the something went wrong
394
+ * @since 4.7.0
395
+ */
396
+ unsetChannel(options: UnsetChannelOptions): Promise<void>;
377
397
  /**
378
398
  * get Channel for this device
379
399
  *
@@ -392,7 +412,7 @@ export interface CapacitorUpdaterPlugin {
392
412
  */
393
413
  setCustomId(options: SetCustomIdOptions): Promise<void>;
394
414
  /**
395
- * Listen for download event in the App, let you know when the download is started, loading and finished
415
+ * Listen for download event in the App, let you know when the download is started, loading and finished, with a percent value
396
416
  *
397
417
  * @since 2.0.11
398
418
  */
package/dist/esm/web.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { WebPlugin } from "@capacitor/core";
2
- import type { CapacitorUpdaterPlugin, BundleInfo, latestVersion, DelayCondition, channelRes, SetChannelOptions, getChannelRes, SetCustomIdOptions } from "./definitions";
2
+ import type { CapacitorUpdaterPlugin, BundleInfo, latestVersion, DelayCondition, channelRes, SetChannelOptions, getChannelRes, SetCustomIdOptions, UnsetChannelOptions } from "./definitions";
3
3
  export declare class CapacitorUpdaterWeb extends WebPlugin implements CapacitorUpdaterPlugin {
4
4
  download(options: {
5
5
  url: string;
@@ -39,6 +39,7 @@ export declare class CapacitorUpdaterWeb extends WebPlugin implements CapacitorU
39
39
  reload(): Promise<void>;
40
40
  getLatest(): Promise<latestVersion>;
41
41
  setChannel(options: SetChannelOptions): Promise<channelRes>;
42
+ unsetChannel(options: UnsetChannelOptions): Promise<void>;
42
43
  setCustomId(options: SetCustomIdOptions): Promise<void>;
43
44
  getChannel(): Promise<getChannelRes>;
44
45
  notifyAppReady(): Promise<{
package/dist/esm/web.js CHANGED
@@ -72,6 +72,10 @@ export class CapacitorUpdaterWeb extends WebPlugin {
72
72
  error: "Cannot setChannel in web",
73
73
  };
74
74
  }
75
+ async unsetChannel(options) {
76
+ console.warn("Cannot unsetChannel in web", options);
77
+ return;
78
+ }
75
79
  async setCustomId(options) {
76
80
  console.warn("Cannot setCustomId in web", options);
77
81
  return;
@@ -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,gCAAg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;IACT,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,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC;IACpC,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"}
@@ -84,6 +84,10 @@ class CapacitorUpdaterWeb extends core.WebPlugin {
84
84
  error: "Cannot setChannel in web",
85
85
  };
86
86
  }
87
+ async unsetChannel(options) {
88
+ console.warn("Cannot unsetChannel in web", options);
89
+ return;
90
+ }
87
91
  async setCustomId(options) {
88
92
  console.warn("Cannot setCustomId in web", options);
89
93
  return;
@@ -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 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: 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,IAAI,MAAM,QAAQ,CAAC,OAAO,EAAE;AAC5B,QAAQ,OAAO,CAAC,IAAI,CAAC,gCAAgC,EAAE,OAAO,CAAC,CAAC;AAChE,QAAQ,OAAO,cAAc,CAAC;AAC9B,KAAK;AACL,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;AACxB,QAAQ,OAAO,CAAC,IAAI,CAAC,gCAAgC,EAAE,OAAO,CAAC,CAAC;AA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,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 unsetChannel(options) {\n console.warn(\"Cannot unsetChannel in web\", options);\n return;\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: 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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AG;AACxB,QAAQ,OAAO,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;AAClD,QAAQ,OAAO;AACf,KAAK;AACL;;;;;;;;;"}
package/dist/plugin.js CHANGED
@@ -83,6 +83,10 @@ var capacitorCapacitorUpdater = (function (exports, core) {
83
83
  error: "Cannot setChannel in web",
84
84
  };
85
85
  }
86
+ async unsetChannel(options) {
87
+ console.warn("Cannot unsetChannel in web", options);
88
+ return;
89
+ }
86
90
  async setCustomId(options) {
87
91
  console.warn("Cannot setCustomId in web", options);
88
92
  return;
@@ -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 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: 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;I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CAAC;IACV,KAAK;IACL,IAAI,MAAM,WAAW,CAAC,OAAO,EAAE;IAC/B,QAAQ,OAAO,CAAC,IAAI,CAAC,2BAA2B,EAAE,OAAO,CAAC,CAAC;IAC3D,QAAQ,OAAO;IACf,KAAK;IACL,IAAI,MAAM,UAAU,GAAG;IACvB,QAAQ,OAAO,CAAC,IAAI,CAAC,0BAA0B,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,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC;IAC1C,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 unsetChannel(options) {\n console.warn(\"Cannot unsetChannel in web\", options);\n return;\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: 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,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AI,MAAM,cAAc,GAAG;IAC3B,QAAQ,OAAO,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;IACvD,QAAQ,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC;IAC1C,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;;;;;;;;;;;;;;;"}
@@ -235,7 +235,7 @@ extension CustomError: LocalizedError {
235
235
  public var versionBuild: String = ""
236
236
  public var customId: String = ""
237
237
  public var PLUGIN_VERSION: String = ""
238
- public let timeout: Double = 20
238
+ public var timeout: Double = 20
239
239
  public var statsUrl: String = ""
240
240
  public var channelUrl: String = ""
241
241
  public var appId: String = ""
@@ -641,6 +641,42 @@ extension CustomError: LocalizedError {
641
641
  self.setBundleStatus(id: bundle.getId(), status: BundleStatus.ERROR)
642
642
  }
643
643
 
644
+ func unsetChannel() -> SetChannel {
645
+ let setChannel: SetChannel = SetChannel()
646
+ if (self.channelUrl ).isEmpty {
647
+ print("\(self.TAG) Channel URL is not set")
648
+ setChannel.message = "Channel URL is not set"
649
+ setChannel.error = "missing_config"
650
+ return setChannel
651
+ }
652
+ let semaphore: DispatchSemaphore = DispatchSemaphore(value: 0)
653
+ var parameters: InfoObject = self.createInfoObject()
654
+
655
+ let request = AF.request(self.channelUrl, method: .delete, parameters: parameters, encoder: JSONParameterEncoder.default, requestModifier: { $0.timeoutInterval = self.timeout })
656
+
657
+ request.validate().responseDecodable(of: SetChannelDec.self) { response in
658
+ switch response.result {
659
+ case .success:
660
+ if let status = response.value?.status {
661
+ setChannel.status = status
662
+ }
663
+ if let error = response.value?.error {
664
+ setChannel.error = error
665
+ }
666
+ if let message = response.value?.message {
667
+ setChannel.message = message
668
+ }
669
+ case let .failure(error):
670
+ print("\(self.TAG) Error unset Channel", response.value ?? "", error)
671
+ setChannel.message = "Error unset Channel \(String(describing: response.value))"
672
+ setChannel.error = "response_error"
673
+ }
674
+ semaphore.signal()
675
+ }
676
+ semaphore.wait()
677
+ return setChannel
678
+ }
679
+
644
680
  func setChannel(channel: String) -> SetChannel {
645
681
  let setChannel: SetChannel = SetChannel()
646
682
  if (self.channelUrl ).isEmpty {
@@ -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.2.35"
18
+ private let PLUGIN_VERSION: String = "5.3.3"
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"
@@ -52,6 +52,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
52
52
  updateUrl = getConfig().getString("updateUrl", CapacitorUpdaterPlugin.updateUrlDefault)!
53
53
  autoUpdate = getConfig().getBoolean("autoUpdate", true)
54
54
  appReadyTimeout = getConfig().getInt("appReadyTimeout", 10000)
55
+ implementation.timeout = Double(getConfig().getInt("responseTimeout", 20))
55
56
  resetWhenUpdate = getConfig().getBoolean("resetWhenUpdate", true)
56
57
 
57
58
  implementation.privateKey = getConfig().getString("privateKey", self.defaultPrivateKey)!
@@ -61,6 +62,12 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
61
62
  if config?["appId"] != nil {
62
63
  implementation.appId = config?["appId"] as! String
63
64
  }
65
+ implementation.appId = getConfig().getString("appId", implementation.appId)!
66
+ if implementation.appId == "" {
67
+ print("\(self.implementation.TAG) appId is empty")
68
+ // crash the app
69
+ fatalError("appId is empty")
70
+ }
64
71
  implementation.statsUrl = getConfig().getString("statsUrl", CapacitorUpdaterPlugin.statsUrlDefault)!
65
72
  implementation.channelUrl = getConfig().getString("channelUrl", CapacitorUpdaterPlugin.channelUrlDefault)!
66
73
  if resetWhenUpdate {
@@ -274,6 +281,22 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
274
281
  }
275
282
  }
276
283
 
284
+ @objc func unsetChannel(_ call: CAPPluginCall) {
285
+ let triggerAutoUpdate = call.getBool("triggerAutoUpdate", false)
286
+ DispatchQueue.global(qos: .background).async {
287
+ let res = self.implementation.unsetChannel()
288
+ if res.error != "" {
289
+ call.reject(res.error)
290
+ } else {
291
+ if self._isAutoUpdateEnabled() && triggerAutoUpdate {
292
+ print("\(self.implementation.TAG) Calling autoupdater after channel change!")
293
+ self.backgroundDownload()
294
+ }
295
+ call.resolve(res.toDict())
296
+ }
297
+ }
298
+ }
299
+
277
300
  @objc func setChannel(_ call: CAPPluginCall) {
278
301
  guard let channel = call.getString("channel") else {
279
302
  print("\(self.implementation.TAG) setChannel called without channel")
@@ -286,7 +309,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
286
309
  if res.error != "" {
287
310
  call.reject(res.error)
288
311
  } else {
289
- if self._isAutoUpdateEnabled() {
312
+ if self._isAutoUpdateEnabled() && triggerAutoUpdate {
290
313
  print("\(self.implementation.TAG) Calling autoupdater after channel change!")
291
314
  self.backgroundDownload()
292
315
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-updater",
3
- "version": "5.2.35",
3
+ "version": "5.3.3",
4
4
  "packageManager": "pnpm@8.7.4",
5
5
  "license": "MPL-2.0",
6
6
  "description": "Live update for capacitor apps",