Screen name tagging added for AP Screen (#8310)

This commit is contained in:
Kishan Kumar
2023-10-26 12:04:33 +05:30
committed by GitHub
parent ef33a614a1
commit 633c2f176b
3 changed files with 27 additions and 2 deletions

View File

@@ -27,6 +27,7 @@ import com.navi.ap.common.models.lambdamodels.PGTokenRequest
import com.navi.ap.common.models.lambdamodels.RPDTokenRequestDetails
import com.navi.ap.common.repository.LambdaRepository
import com.navi.ap.network.retrofit.ApRepoResult
import com.navi.ap.utils.EventUtil
import com.navi.ap.utils.appendIndexToDataKeys
import com.navi.ap.utils.appendIndexToWidgetData
import com.navi.ap.utils.constants.ALL_BANKS_BRANCH_LIST
@@ -90,8 +91,10 @@ import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import org.json.JSONObject
open class LambdaVM constructor(val repository: LambdaRepository) :
ApplicationPlatformVM(repository = repository) {
open class LambdaVM constructor(
val repository: LambdaRepository,
val eventUtils: EventUtil = EventUtil(),
) : ApplicationPlatformVM(repository = repository) {
private val _lambdaState = MutableStateFlow<LambdaState>(LambdaState.Nothing)
val lambdaState = _lambdaState.asStateFlow()

View File

@@ -35,6 +35,7 @@ import com.navi.ap.utils.constants.ApScreenDestinations
import com.navi.ap.utils.constants.SCREEN_TYPE
import com.navi.ap.utils.constants.UNDERSCORE_POLL
import com.navi.ap.utils.constants.noLoaderScreenTypes
import com.navi.ap.utils.EventUtil
import com.navi.base.utils.orElse
import com.navi.common.utils.EMPTY
import com.ramcosta.composedestinations.annotation.Destination
@@ -54,6 +55,7 @@ fun ApGenericScreen(
LaunchedEffect(Unit) {
viewModel.setQueryMap(bundle)
viewModel.eventUtils.setCurrentScreen(activity = activity, screenName = viewModel.getQueryMap()[APP_PLATFORM_SCREEN_ID].orEmpty())
activity.getApplicationPlatformSharedVM().getScreenDefinitionStructure()?.let {
viewModel.setScreenDefinitionResponse(it)
activity.getApplicationPlatformSharedVM()

View File

@@ -0,0 +1,20 @@
package com.navi.ap.utils
import android.app.Activity
import com.navi.analytics.firebase.FcmAnalyticsUtil
import timber.log.Timber
class EventUtil{
fun setCurrentScreen(activity : Activity, screenName : String){
try {
FcmAnalyticsUtil.analytics.firebaseAnalyticsInstance.setCurrentScreen(
activity,
screenName,
activity::class.java.simpleName
)
} catch (e: Exception) {
Timber.e(e)
}
}
}