mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-09-16 08:41:37 +08:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
a913e8c10e | ||
![]() |
c5f458291a | ||
![]() |
9699632a43 | ||
![]() |
80e42f5dba |
@@ -52,7 +52,7 @@ function App() {
|
||||
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<Text style={styles.welcome}>欢迎使用Pushy热更新服务</Text>
|
||||
<Text style={styles.welcome}>欢迎xxx使用Pushy热更新服务</Text>
|
||||
<View style={{flexDirection: 'row'}}>
|
||||
<Text>
|
||||
{useDefaultAlert ? '当前使用' : '当前不使用'}默认的alert更新提示
|
||||
|
@@ -1 +1 @@
|
||||
["https://pushy-koa-qgbgqmcpis.cn-beijing.fcapp.run", "https://p.reactnative.cn/api"]
|
||||
["https://p.reactnative.cn/api"]
|
||||
|
@@ -542,7 +542,15 @@ RCT_EXPORT_METHOD(markSuccess:(RCTPromiseResolveBlock)resolve
|
||||
callback([self errorWithMessage:ERROR_HDIFFPATCH]);
|
||||
}
|
||||
};
|
||||
[_fileManager hdiffFileAtPath:bundlePatch fromOrigin:bundleOrigin toDestination:destination completionHandler:completionHandler];
|
||||
|
||||
@try {
|
||||
[_fileManager hdiffFileAtPath:bundlePatch fromOrigin:bundleOrigin toDestination:destination completionHandler:completionHandler];
|
||||
}
|
||||
@catch (NSException *exception) {
|
||||
NSLog(@"Pushy _dopatch error: exception occurred during hdiffFileAtPath: %@, reason: %@",
|
||||
exception.name, exception.reason);
|
||||
callback([self errorWithMessage:ERROR_HDIFFPATCH]);
|
||||
}
|
||||
}
|
||||
|
||||
- (void)patch:(NSString *)hash fromBundle:(NSString *)bundleOrigin source:(NSString *)sourceOrigin callback:(void (^)(NSError *error))callback
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-native-update",
|
||||
"version": "10.29.6",
|
||||
"version": "10.29.8",
|
||||
"description": "react-native hot update",
|
||||
"main": "src/index",
|
||||
"scripts": {
|
||||
|
@@ -148,6 +148,7 @@ export class Pushy {
|
||||
await this.loggerPromise.promise;
|
||||
const { logger = noop, appKey } = this.options;
|
||||
const info = await getCurrentVersionInfo();
|
||||
const overridePackageVersion = this.options.overridePackageVersion;
|
||||
logger({
|
||||
type,
|
||||
data: {
|
||||
@@ -155,6 +156,7 @@ export class Pushy {
|
||||
currentVersion,
|
||||
cInfo,
|
||||
packageVersion,
|
||||
overridePackageVersion,
|
||||
buildTime,
|
||||
message,
|
||||
...info,
|
||||
@@ -233,7 +235,7 @@ export class Pushy {
|
||||
}
|
||||
this.lastChecking = now;
|
||||
const fetchBody = {
|
||||
packageVersion,
|
||||
packageVersion: this.options.overridePackageVersion || packageVersion,
|
||||
hash: currentVersion,
|
||||
buildTime,
|
||||
cInfo,
|
||||
@@ -391,7 +393,12 @@ export class Pushy {
|
||||
}
|
||||
}
|
||||
let succeeded = '';
|
||||
this.report({ type: 'downloading' });
|
||||
this.report({
|
||||
type: 'downloading',
|
||||
data: {
|
||||
newVersion: hash,
|
||||
},
|
||||
});
|
||||
let lastError: any;
|
||||
let errorMessages: string[] = [];
|
||||
const diffUrl = await testUrls(joinUrls(paths, diff));
|
||||
|
@@ -93,6 +93,7 @@ export interface ClientOptions {
|
||||
beforeDownloadUpdate?: (info: CheckResult) => Promise<boolean>;
|
||||
afterDownloadUpdate?: (info: CheckResult) => Promise<boolean>;
|
||||
onPackageExpired?: (info: CheckResult) => Promise<boolean>;
|
||||
overridePackageVersion?: string;
|
||||
}
|
||||
|
||||
export interface UpdateTestPayload {
|
||||
|
Reference in New Issue
Block a user