@hot-updater/react-native 0.15.0 → 0.15.1

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/dist/index.d.ts CHANGED
@@ -47,8 +47,9 @@ export declare const HotUpdater: {
47
47
  * Fetches the current release channel of the app.
48
48
  *
49
49
  * By default, if no channel is specified, the app is assigned to the 'production' channel.
50
+ * If the app is running in development mode, the channel will be `null`.
50
51
  *
51
- * @returns {string} The current release channel of the app
52
+ * @returns {string | null} The current release channel of the app
52
53
  *
53
54
  * @example
54
55
  * ```ts
@@ -56,7 +57,7 @@ export declare const HotUpdater: {
56
57
  * console.log(`Current channel: ${channel}`);
57
58
  * ```
58
59
  */
59
- getChannel: () => string;
60
+ getChannel: () => string | null;
60
61
  /**
61
62
  * Adds a listener to HotUpdater events.
62
63
  *
package/dist/index.js CHANGED
@@ -149,7 +149,7 @@ var __webpack_exports__ = {};
149
149
  bundleId: currentBundleId,
150
150
  platform,
151
151
  minBundleId,
152
- channel
152
+ channel: channel ?? void 0
153
153
  }, options.requestHeaders, options.onError);
154
154
  }
155
155
  const runUpdateProcess = async ({ reloadOnForceUpdate = true, ...checkForUpdateOptions })=>{
package/dist/index.mjs CHANGED
@@ -124,7 +124,7 @@ async function checkForUpdate(options) {
124
124
  bundleId: currentBundleId,
125
125
  platform,
126
126
  minBundleId,
127
- channel
127
+ channel: channel ?? void 0
128
128
  }, options.requestHeaders, options.onError);
129
129
  }
130
130
  const runUpdateProcess = async ({ reloadOnForceUpdate = true, ...checkForUpdateOptions })=>{
package/dist/native.d.ts CHANGED
@@ -34,4 +34,4 @@ export declare const getMinBundleId: () => string;
34
34
  * @returns {Promise<string>} Resolves with the current version id or null if not available.
35
35
  */
36
36
  export declare const getBundleId: () => string;
37
- export declare const getChannel: () => string;
37
+ export declare const getChannel: () => string | null;
@@ -412,7 +412,10 @@ RCT_EXPORT_MODULE();
412
412
  RCT_EXPORT_METHOD(reload) {
413
413
  NSLog(@"HotUpdater requested a reload");
414
414
  dispatch_async(dispatch_get_main_queue(), ^{
415
- [super.bridge setValue:[HotUpdater bundleURL] forKey:@"bundleURL"];
415
+ NSURL *bundleURL = [HotUpdater bundleURL];
416
+ if (bundleURL) {
417
+ [super.bridge setValue:bundleURL forKey:@"bundleURL"];
418
+ }
416
419
  RCTTriggerReloadCommandListeners(@"HotUpdater requested a reload");
417
420
  });
418
421
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hot-updater/react-native",
3
- "version": "0.15.0",
3
+ "version": "0.15.1",
4
4
  "description": "React Native OTA solution for self-hosted",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -81,8 +81,8 @@
81
81
  },
82
82
  "dependencies": {
83
83
  "use-sync-external-store": "1.4.0",
84
- "@hot-updater/js": "0.15.0",
85
- "@hot-updater/core": "0.15.0"
84
+ "@hot-updater/js": "0.15.1",
85
+ "@hot-updater/core": "0.15.1"
86
86
  },
87
87
  "scripts": {
88
88
  "build": "rslib build",
@@ -44,7 +44,7 @@ export async function checkForUpdate(options: CheckForUpdateOptions) {
44
44
  bundleId: currentBundleId,
45
45
  platform,
46
46
  minBundleId,
47
- channel,
47
+ channel: channel ?? undefined,
48
48
  },
49
49
  options.requestHeaders,
50
50
  options.onError,
package/src/index.ts CHANGED
@@ -67,8 +67,9 @@ export const HotUpdater = {
67
67
  * Fetches the current release channel of the app.
68
68
  *
69
69
  * By default, if no channel is specified, the app is assigned to the 'production' channel.
70
+ * If the app is running in development mode, the channel will be `null`.
70
71
  *
71
- * @returns {string} The current release channel of the app
72
+ * @returns {string | null} The current release channel of the app
72
73
  *
73
74
  * @example
74
75
  * ```ts
package/src/native.ts CHANGED
@@ -103,6 +103,6 @@ export const getBundleId = (): string => {
103
103
  : HotUpdater.HOT_UPDATER_BUNDLE_ID;
104
104
  };
105
105
 
106
- export const getChannel = (): string => {
106
+ export const getChannel = (): string | null => {
107
107
  return HotUpdater.CHANNEL;
108
108
  };