Skip to content

Commit b8bd9c3

Browse files
author
Russell.H.Sun
committed
add downloadApkName
1 parent 019b30c commit b8bd9c3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const isAndroid = Platform.OS === 'android';
88

99
const VERSION_NAME = RNEasyUpgrade.versionName;
1010
const VERSION_CODE = RNEasyUpgrade.versionCode;
11-
const DEFAULT_DOWNLOAD_APK_NAME = `Temp_App${VERSION_NAME}2.apk`;
11+
const DEFAULT_DOWNLOAD_APK_NAME = `newVersion.apk`;
1212

1313
const DocumentDirectoryPath = isAndroid && RNEasyUpgrade.RNDocumentDirectoryPath;
1414

@@ -17,7 +17,7 @@ const defaults = {
1717
downloadTitle: '下载更新包',
1818
downloadDescription: '新版本更新包下载中',
1919
downloadDestDirectory: DocumentDirectoryPath,
20-
downloadDestPath: `${DocumentDirectoryPath}/${DEFAULT_DOWNLOAD_APK_NAME}`,
20+
downloadApkName: DEFAULT_DOWNLOAD_APK_NAME,
2121
downloadApkEnd: path => RNEasyUpgrade.installApk(path),
2222
onError: () => {}
2323
};
@@ -34,7 +34,7 @@ class AppUpgrade {
3434
}
3535

3636
get downloadDestPath() {
37-
return this.options.downloadDestPath;
37+
return this.options.downloadDestDirectory + this.options.downloadApkName;
3838
}
3939

4040
get downloadDestDirectory() {
@@ -76,7 +76,7 @@ class AppUpgrade {
7676
const downloadConf = {
7777
downloadTitle: this.options.downloadTitle,
7878
downloadDescription: this.options.downloadDescription,
79-
saveAsName: DEFAULT_DOWNLOAD_APK_NAME,
79+
saveAsName: this.options.downloadApkName,
8080
allowedInRoaming: true,
8181
allowedInMetered: true,
8282
showInDownloads: true,

0 commit comments

Comments
 (0)