mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-09-16 07:01:38 +08:00
update welcome message in App component and add overridePackageVersion option to ClientOptions
This commit is contained in:
@@ -52,7 +52,7 @@ function App() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
<Text style={styles.welcome}>欢迎使用Pushy热更新服务</Text>
|
<Text style={styles.welcome}>欢迎xxx使用Pushy热更新服务</Text>
|
||||||
<View style={{flexDirection: 'row'}}>
|
<View style={{flexDirection: 'row'}}>
|
||||||
<Text>
|
<Text>
|
||||||
{useDefaultAlert ? '当前使用' : '当前不使用'}默认的alert更新提示
|
{useDefaultAlert ? '当前使用' : '当前不使用'}默认的alert更新提示
|
||||||
|
@@ -148,6 +148,7 @@ export class Pushy {
|
|||||||
await this.loggerPromise.promise;
|
await this.loggerPromise.promise;
|
||||||
const { logger = noop, appKey } = this.options;
|
const { logger = noop, appKey } = this.options;
|
||||||
const info = await getCurrentVersionInfo();
|
const info = await getCurrentVersionInfo();
|
||||||
|
const overridePackageVersion = this.options.overridePackageVersion;
|
||||||
logger({
|
logger({
|
||||||
type,
|
type,
|
||||||
data: {
|
data: {
|
||||||
@@ -155,6 +156,7 @@ export class Pushy {
|
|||||||
currentVersion,
|
currentVersion,
|
||||||
cInfo,
|
cInfo,
|
||||||
packageVersion,
|
packageVersion,
|
||||||
|
overridePackageVersion,
|
||||||
buildTime,
|
buildTime,
|
||||||
message,
|
message,
|
||||||
...info,
|
...info,
|
||||||
@@ -233,7 +235,7 @@ export class Pushy {
|
|||||||
}
|
}
|
||||||
this.lastChecking = now;
|
this.lastChecking = now;
|
||||||
const fetchBody = {
|
const fetchBody = {
|
||||||
packageVersion,
|
packageVersion: this.options.overridePackageVersion || packageVersion,
|
||||||
hash: currentVersion,
|
hash: currentVersion,
|
||||||
buildTime,
|
buildTime,
|
||||||
cInfo,
|
cInfo,
|
||||||
|
@@ -93,6 +93,7 @@ export interface ClientOptions {
|
|||||||
beforeDownloadUpdate?: (info: CheckResult) => Promise<boolean>;
|
beforeDownloadUpdate?: (info: CheckResult) => Promise<boolean>;
|
||||||
afterDownloadUpdate?: (info: CheckResult) => Promise<boolean>;
|
afterDownloadUpdate?: (info: CheckResult) => Promise<boolean>;
|
||||||
onPackageExpired?: (info: CheckResult) => Promise<boolean>;
|
onPackageExpired?: (info: CheckResult) => Promise<boolean>;
|
||||||
|
overridePackageVersion?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface UpdateTestPayload {
|
export interface UpdateTestPayload {
|
||||||
|
Reference in New Issue
Block a user