Skip to content

Commit c5f4582

Browse files
committed
update welcome message in App component and add overridePackageVersion option to ClientOptions
1 parent 9699632 commit c5f4582

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

Example/testHotUpdate/src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function App() {
5252

5353
return (
5454
<View style={styles.container}>
55-
<Text style={styles.welcome}>欢迎使用Pushy热更新服务</Text>
55+
<Text style={styles.welcome}>欢迎xxx使用Pushy热更新服务</Text>
5656
<View style={{flexDirection: 'row'}}>
5757
<Text>
5858
{useDefaultAlert ? '当前使用' : '当前不使用'}默认的alert更新提示

src/client.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,15 @@ export class Pushy {
148148
await this.loggerPromise.promise;
149149
const { logger = noop, appKey } = this.options;
150150
const info = await getCurrentVersionInfo();
151+
const overridePackageVersion = this.options.overridePackageVersion;
151152
logger({
152153
type,
153154
data: {
154155
appKey,
155156
currentVersion,
156157
cInfo,
157158
packageVersion,
159+
overridePackageVersion,
158160
buildTime,
159161
message,
160162
...info,
@@ -233,7 +235,7 @@ export class Pushy {
233235
}
234236
this.lastChecking = now;
235237
const fetchBody = {
236-
packageVersion,
238+
packageVersion: this.options.overridePackageVersion || packageVersion,
237239
hash: currentVersion,
238240
buildTime,
239241
cInfo,

src/type.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ export interface ClientOptions {
9393
beforeDownloadUpdate?: (info: CheckResult) => Promise<boolean>;
9494
afterDownloadUpdate?: (info: CheckResult) => Promise<boolean>;
9595
onPackageExpired?: (info: CheckResult) => Promise<boolean>;
96+
overridePackageVersion?: string;
9697
}
9798

9899
export interface UpdateTestPayload {

0 commit comments

Comments
 (0)