File tree Expand file tree Collapse file tree 3 files changed +5
-2
lines changed
Example/testHotUpdate/src Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Original file line number Diff line number Diff 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更新提示
Original file line number Diff line number Diff 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,
Original file line number Diff line number Diff 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
9899export interface UpdateTestPayload {
You can’t perform that action at this time.
0 commit comments