NTP-49724 | Temporary changes to track QR open time (#15752)

This commit is contained in:
shankar yadav
2025-04-11 16:13:19 +05:30
committed by GitHub
parent bd36deeb63
commit 0193904c61
4 changed files with 19 additions and 1 deletions

View File

@@ -239,6 +239,9 @@ constructor(
activity: HomePageActivity,
callBackToActivityScreen: (callback: HomeScreenCallbackListener) -> Unit,
) {
if (naviClickAction.url == "naviPay/NAVI_PAY_QR_SCANNER_SCREEN") {
TemporaryStorageHelper.scanAndPayClickTime = System.currentTimeMillis()
}
ctaHandler.handleCtaData(naviClickAction, activity, callBackToActivityScreen) {
sendEvent(HpEvents.ShowProfile)
}

View File

@@ -1,6 +1,6 @@
/*
*
* * Copyright © 2023-2024 by Navi Technologies Limited
* * Copyright © 2023-2025 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
@@ -36,6 +36,9 @@ object TemporaryStorageHelper {
var isOkHttpRetryEnabled: Boolean = false
var customDnsValue: String = "8.8.8.8"
// temporary changes, will be removed in the next release
var scanAndPayClickTime = 0L
/**
* Used to store custom key-value pairs with a scope limited to the session. For example, in
* React Native, it can track if a bottom sheet has been viewed during a session and disable it

View File

@@ -1772,6 +1772,7 @@ class NaviPayAnalytics private constructor() {
fun onQrCameraStateChange(
streamState: PreviewView.StreamState,
naviPaySessionAttributes: Map<String, String>,
qrScreenStateLoadTime: Long,
) {
NaviTrackEvent.trackEventOnClickStream(
eventName = "NaviPay_QrScanner_CameraStateChange",
@@ -1782,6 +1783,7 @@ class NaviPayAnalytics private constructor() {
naviPaySessionAttributes["naviPaySessionId"].orEmpty(),
"naviPayCustomerStatusMap" to
naviPaySessionAttributes["naviPayCustomerStatusMap"].orEmpty(),
"qrScreenStateLoadTime" to qrScreenStateLoadTime.toString(),
),
)
}

View File

@@ -83,6 +83,7 @@ import com.google.mlkit.vision.barcode.common.Barcode
import com.google.mlkit.vision.common.InputImage
import com.navi.alfred.AlfredManager
import com.navi.common.R as CommonR
import com.navi.common.utils.TemporaryStorageHelper
import com.navi.common.utils.log
import com.navi.common.utils.navigateUp
import com.navi.design.font.FontWeightEnum
@@ -664,10 +665,19 @@ private fun QrCamera(
this.implementationMode = PreviewView.ImplementationMode.COMPATIBLE
}
previewView.previewStreamState.observe(lifecycleOwner) {
var qrScreenStateLoadTime = -1L
if (TemporaryStorageHelper.scanAndPayClickTime != 0L) {
qrScreenStateLoadTime =
System.currentTimeMillis() - TemporaryStorageHelper.scanAndPayClickTime
}
naviPayAnalytics.onQrCameraStateChange(
streamState = it,
naviPaySessionAttributes = naviPaySessionAttributes,
qrScreenStateLoadTime = qrScreenStateLoadTime,
)
if (it.name == "STREAMING") {
TemporaryStorageHelper.scanAndPayClickTime = 0L
}
}
previewView
}