TP-65905 | Lending Permission Screen Event (#11059)
This commit is contained in:
@@ -66,7 +66,6 @@ import javax.inject.Inject
|
||||
class LendingPermissionActivity : BaseActivity() {
|
||||
|
||||
private val viewModel by viewModels<LendingPermissionViewModel>()
|
||||
private val userDataAnalyticsTracker by lazy { NaviAnalytics.naviAnalytics.UserData() }
|
||||
private val analyticsTracker by lazy {
|
||||
NaviAnalytics.naviAnalytics.LendingPermission(screenName)
|
||||
}
|
||||
@@ -123,7 +122,10 @@ class LendingPermissionActivity : BaseActivity() {
|
||||
ContentShimmer()
|
||||
}
|
||||
is NetworkResponseState.Success -> {
|
||||
analyticsTracker.lendingPermissionEvent(eventName = LENDING_PERMISSION_PAGE_LANDS)
|
||||
analyticsTracker.lendingPermissionEvent(
|
||||
eventName = LENDING_PERMISSION_PAGE_LANDS,
|
||||
verticalType = intent.getStringExtra(VERTICAL_TYPE)
|
||||
)
|
||||
Scaffold(
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
topBar = { SetHeaderWidget(lendingPermissionScreenDataState, viewModel) },
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2019-2023 by Navi Technologies Limited
|
||||
* * Copyright © 2019-2024 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
@@ -13,12 +13,19 @@ import android.app.Activity
|
||||
import android.app.Application
|
||||
import android.content.Context
|
||||
import android.location.LocationManager
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.os.Looper
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.google.android.gms.common.api.ResolvableApiException
|
||||
import com.google.android.gms.location.*
|
||||
import com.google.android.gms.location.LocationAvailability
|
||||
import com.google.android.gms.location.LocationCallback
|
||||
import com.google.android.gms.location.LocationRequest
|
||||
import com.google.android.gms.location.LocationResult
|
||||
import com.google.android.gms.location.LocationServices
|
||||
import com.google.android.gms.location.LocationSettingsRequest
|
||||
import com.google.android.gms.location.LocationSettingsResponse
|
||||
import com.google.android.gms.tasks.Task
|
||||
import com.navi.analytics.model.EventData
|
||||
import com.navi.analytics.model.LocationPrecision
|
||||
@@ -110,9 +117,13 @@ class NaviLocationManager(val applicationContext: Context? = CommonLibManager.ap
|
||||
IS_MOCK_LOCATION,
|
||||
location.isFromMockProvider
|
||||
)
|
||||
|
||||
NaviTrackEvent.trackLocation(location.latitude, location.longitude)
|
||||
fusedLocationClient?.removeLocationUpdates(this)
|
||||
analyticsTracker.onFreshLocationReceived(isLocationNeedToPost)
|
||||
analyticsTracker.onFreshLocationReceived(
|
||||
isLocationNeedToPost,
|
||||
isMockLocationEnable = isMockLocationEnable(locationResult)
|
||||
)
|
||||
if (isLocationNeedToPost) postLocation(userLocation)
|
||||
else analyticsTracker.onNewLocationReceivedButNotSent()
|
||||
}
|
||||
@@ -304,6 +315,14 @@ class NaviLocationManager(val applicationContext: Context? = CommonLibManager.ap
|
||||
this.screenName = screenName
|
||||
}
|
||||
|
||||
private fun isMockLocationEnable(locationResult: LocationResult): Boolean? {
|
||||
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||
locationResult.lastLocation?.isMock
|
||||
} else {
|
||||
locationResult.lastLocation?.isFromMockProvider
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val REQUEST_LOCATION_SETTINGS = 100
|
||||
private const val LOCATION_LAST_UPDATED_TIME = "LOCATION_LAST_UPDATED_TIME"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2022-2023 by Navi Technologies Limited
|
||||
* * Copyright © 2022-2024 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
@@ -327,10 +327,13 @@ class CommonNaviAnalytics private constructor() {
|
||||
mapOf(Pair("available", isAvailable.toString()))
|
||||
)
|
||||
|
||||
fun onFreshLocationReceived(locationNeedToPost: Boolean) {
|
||||
fun onFreshLocationReceived(locationNeedToPost: Boolean, isMockLocationEnable: Boolean?) {
|
||||
NaviTrackEvent.trackEvent(
|
||||
"new_location_received",
|
||||
mapOf(Pair("location_sent_flag", locationNeedToPost.toString()))
|
||||
mapOf(
|
||||
Pair("location_sent_flag", locationNeedToPost.toString()),
|
||||
Pair("is_mock_location_enable", isMockLocationEnable.toString())
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user