Fix: Improve Android build version retrieval
Improve error handling and logging in BuildInfoPlugin.java. Enhance type conversion and error handling in getAppVersionInfo() in platform.ts to ensure correct version information display.
This commit is contained in:
@@ -28,22 +28,24 @@ const BuildInfo: BuildInfoPlugin = {
|
||||
// android/version.properties 또는 ios의 Info.plist에서
|
||||
// 설정된 값을 반환하는 네이티브 구현이 런타임에 이 함수를 대체함
|
||||
|
||||
// 네이티브 구현이 없을 경우를 위한 기본값
|
||||
// 네이티브 구현이 없을 경우를 위한 기본값 (최신 버전)
|
||||
return {
|
||||
versionName: '1.0.1',
|
||||
versionCode: 1,
|
||||
buildNumber: 3,
|
||||
versionName: '1.1.1.2',
|
||||
versionCode: 6,
|
||||
buildNumber: 6,
|
||||
platform: 'native',
|
||||
isDefault: true
|
||||
isDefault: true,
|
||||
timestamp: new Date().toISOString()
|
||||
};
|
||||
} catch (error) {
|
||||
console.error('BuildInfo.getBuildInfo() 오류:', error);
|
||||
// 오류 발생 시에도 앱 실행은 계속되도록 기본값 반환
|
||||
return {
|
||||
versionName: '1.0.0',
|
||||
versionCode: 1,
|
||||
buildNumber: 1,
|
||||
error: true
|
||||
versionName: '1.1.1.2',
|
||||
versionCode: 6,
|
||||
buildNumber: 6,
|
||||
error: true,
|
||||
errorMessage: error instanceof Error ? error.message : String(error)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user