NTP-24283 | Navi link Add Analytic event (#14963)
This commit is contained in:
committed by
GitHub
parent
709879ffa9
commit
dbc3d4e658
@@ -98,4 +98,11 @@ class NaviDeeplinkAnalytics @Inject constructor() {
|
||||
fun sendNaviLinkDataFailEvent() {
|
||||
NaviTrackEvent.trackEventOnClickStream(eventName = "NaviLink_Data_Fail_Event")
|
||||
}
|
||||
|
||||
fun sendNativeDeepLinkEvent(deeplink: String, naviLink: String) {
|
||||
NaviTrackEvent.trackEventOnClickStream(
|
||||
eventName = "Native_Deep_Link_Event",
|
||||
eventValues = mapOf("deeplink" to deeplink, "naviLink" to naviLink),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,6 +72,7 @@ class DeeplinkManagementActivity : BaseLauncherActivity() {
|
||||
super.onCreate(savedInstanceState)
|
||||
if (BaseUtils.isUserLoggedIn().not()) {
|
||||
navigateToLogin()
|
||||
return
|
||||
}
|
||||
if (isNetworkAvailable().not()) {
|
||||
navigateToHome()
|
||||
|
||||
@@ -21,7 +21,7 @@ class DeeplinkManagerFactory {
|
||||
DeeplinkType.APPSFLYER -> AppsFlyerDeeplinkManager()
|
||||
DeeplinkType.NAVI_PAY -> NaviPayDeeplinkManager()
|
||||
DeeplinkType.BRANCH_IO -> BranchDeeplinkManager(analyticsTracker)
|
||||
DeeplinkType.NATIVE -> NativeDeeplinkManager()
|
||||
DeeplinkType.NATIVE -> NativeDeeplinkManager(analyticsTracker)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import com.navi.chat.utils.HOME_SCREEN
|
||||
import com.navi.chat.utils.SCREEN_NAME
|
||||
import com.naviapp.analytics.deeplink.DeeplinkType
|
||||
import com.naviapp.common.navigator.NaviDeepLinkNavigator
|
||||
import com.naviapp.deeplinkmanagement.analytics.NaviDeeplinkAnalytics
|
||||
import com.naviapp.models.DeeplinkData
|
||||
import com.naviapp.registration.helper.getChatParams
|
||||
import com.naviapp.registration.helper.isNotificationAlive
|
||||
@@ -26,7 +27,8 @@ import com.naviapp.utils.Constants.NAVILINK
|
||||
import com.naviapp.utils.isPublicPage
|
||||
import kotlin.reflect.KFunction1
|
||||
|
||||
class NativeDeeplinkManager : IDeeplinkManager {
|
||||
class NativeDeeplinkManager(private val analyticsTracker: NaviDeeplinkAnalytics) :
|
||||
IDeeplinkManager {
|
||||
|
||||
override fun handleDeeplink(
|
||||
intent: Intent,
|
||||
@@ -35,8 +37,13 @@ class NativeDeeplinkManager : IDeeplinkManager {
|
||||
processDeeplink: KFunction1<DeeplinkData, Unit>,
|
||||
processNaviLink: ((String) -> Unit)?,
|
||||
) {
|
||||
|
||||
var deeplink = intent.getStringExtra(Constants.DEEPLINK).orEmpty()
|
||||
var param: ArrayList<LineItem>? = null
|
||||
analyticsTracker.sendNativeDeepLinkEvent(
|
||||
deeplink = deeplink,
|
||||
naviLink = intent.getStringExtra(Constants.NAVILINK_SMALL).orEmpty(),
|
||||
)
|
||||
|
||||
when {
|
||||
handleNaviLink(intent, processNaviLink) -> return
|
||||
@@ -84,10 +91,10 @@ private fun handleNaviLink(intent: Intent, processNaviLink: ((String) -> Unit)?)
|
||||
}
|
||||
|
||||
fun getNaviLinkIdentifier(intent: Intent): String? {
|
||||
val navilink = intent.getStringExtra(Constants.NAVILINK_SMALL).orEmpty()
|
||||
val naviLink = intent.getStringExtra(Constants.NAVILINK_SMALL).orEmpty()
|
||||
val identifiers =
|
||||
when {
|
||||
navilink.isNotEmpty() -> navilink.split("/")
|
||||
naviLink.isNotEmpty() -> naviLink.split("/")
|
||||
else -> emptyList()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user