react-native-update 10.29.7 → 10.29.9

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.
@@ -361,6 +361,9 @@ RCT_EXPORT_METHOD(restartApp:(RCTPromiseResolveBlock)resolve
361
361
  RCT_EXPORT_METHOD(markSuccess:(RCTPromiseResolveBlock)resolve
362
362
  rejecter:(RCTPromiseRejectBlock)reject)
363
363
  {
364
+ #if DEBUG
365
+ resolve(@true);
366
+ #else
364
367
 
365
368
  @try {
366
369
  // up package info
@@ -384,6 +387,7 @@ RCT_EXPORT_METHOD(markSuccess:(RCTPromiseResolveBlock)resolve
384
387
  @catch (NSException *exception) {
385
388
  reject(@"执行报错", nil, nil);
386
389
  }
390
+ #endif
387
391
  }
388
392
 
389
393
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-update",
3
- "version": "10.29.7",
3
+ "version": "10.29.9",
4
4
  "description": "react-native hot update",
5
5
  "main": "src/index",
6
6
  "scripts": {
package/src/client.ts CHANGED
@@ -148,6 +148,7 @@ export class Pushy {
148
148
  await this.loggerPromise.promise;
149
149
  const { logger = noop, appKey } = this.options;
150
150
  const info = await getCurrentVersionInfo();
151
+ const overridePackageVersion = this.options.overridePackageVersion;
151
152
  logger({
152
153
  type,
153
154
  data: {
@@ -155,6 +156,7 @@ export class Pushy {
155
156
  currentVersion,
156
157
  cInfo,
157
158
  packageVersion,
159
+ overridePackageVersion,
158
160
  buildTime,
159
161
  message,
160
162
  ...info,
@@ -233,7 +235,7 @@ export class Pushy {
233
235
  }
234
236
  this.lastChecking = now;
235
237
  const fetchBody = {
236
- packageVersion,
238
+ packageVersion: this.options.overridePackageVersion || packageVersion,
237
239
  hash: currentVersion,
238
240
  buildTime,
239
241
  cInfo,
@@ -391,7 +393,12 @@ export class Pushy {
391
393
  }
392
394
  }
393
395
  let succeeded = '';
394
- this.report({ type: 'downloading' });
396
+ this.report({
397
+ type: 'downloading',
398
+ data: {
399
+ newVersion: hash,
400
+ },
401
+ });
395
402
  let lastError: any;
396
403
  let errorMessages: string[] = [];
397
404
  const diffUrl = await testUrls(joinUrls(paths, diff));
package/src/type.ts CHANGED
@@ -93,6 +93,7 @@ export interface ClientOptions {
93
93
  beforeDownloadUpdate?: (info: CheckResult) => Promise<boolean>;
94
94
  afterDownloadUpdate?: (info: CheckResult) => Promise<boolean>;
95
95
  onPackageExpired?: (info: CheckResult) => Promise<boolean>;
96
+ overridePackageVersion?: string;
96
97
  }
97
98
 
98
99
  export interface UpdateTestPayload {