NTP-58594 | Naman Khurmi | App update analytic crash fix. (#16048)

This commit is contained in:
Naman Khurmi
2025-05-05 17:18:24 +05:30
committed by GitHub
parent 983e3cee3d
commit e4e759a1bf
2 changed files with 3 additions and 14 deletions

View File

@@ -61,10 +61,7 @@ class InAppUpdateHelper(
InstallStatus.DOWNLOADING -> {
inAppUpdateBridge.setAppUpdateState(AppUpdateState.UPDATE_DOWNLOADING)
naviAnalyticsInAppUpdate.onDownloadProgress(
bytesDownloaded = state.bytesDownloaded(),
totalBytesToDownload = state.totalBytesToDownload(),
downloadProgress =
(state.bytesDownloaded() * 100 / state.totalBytesToDownload()),
appUpdateInfo?.availableVersionCode()
)
}
InstallStatus.INSTALLING -> {

View File

@@ -343,18 +343,10 @@ class CommonNaviAnalytics private constructor() {
)
}
fun onDownloadProgress(
bytesDownloaded: Long,
totalBytesToDownload: Long,
downloadProgress: Long,
) {
fun onDownloadProgress(versionCode: Int?) {
NaviTrackEvent.trackEvent(
"dev_in_app_update_download_progress",
mapOf(
"bytes_downloaded" to bytesDownloaded.toString(),
"total_bytes" to totalBytesToDownload.toString(),
"download_progress" to downloadProgress.toString(),
),
mapOf("version_code" to (versionCode?.toString() ?: "")),
)
}