diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/child/wallet/model/intents/WalletWarningsClickIntents.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/child/wallet/model/intents/WalletWarningsClickIntents.kt index a1fd62f56e..d1e7c8cba5 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/child/wallet/model/intents/WalletWarningsClickIntents.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/child/wallet/model/intents/WalletWarningsClickIntents.kt @@ -44,6 +44,7 @@ import com.tangem.domain.wallets.usecase.SeedPhraseNotificationUseCase import com.tangem.domain.wallets.usecase.UnlockWalletsUseCase import com.tangem.feature.wallet.child.wallet.model.WalletActivationBannerType import com.tangem.feature.wallet.impl.R +import com.tangem.feature.wallet.presentation.wallet.analytics.WalletScreenAnalyticsEvent import com.tangem.feature.wallet.presentation.wallet.analytics.WalletScreenAnalyticsEvent.Basic import com.tangem.feature.wallet.presentation.wallet.analytics.WalletScreenAnalyticsEvent.MainScreen import com.tangem.feature.wallet.presentation.wallet.domain.ScanCardToUnlockWalletClickHandler @@ -55,6 +56,7 @@ import com.tangem.feature.wallet.presentation.wallet.state.model.WalletEvent import com.tangem.feature.wallet.presentation.wallet.state.transformers.CloseBottomSheetTransformer import com.tangem.feature.wallet.presentation.wallet.state.utils.WalletEventSender import com.tangem.features.hotwallet.HotWalletFeatureToggles +import com.tangem.features.pushnotifications.api.analytics.PushNotificationAnalyticEvents import com.tangem.utils.coroutines.CoroutineDispatcherProvider import kotlinx.coroutines.async import kotlinx.coroutines.awaitAll @@ -474,19 +476,33 @@ internal class WalletWarningsClickIntentsImplementor @Inject constructor( } override fun onAllowPermissions() { + analyticsEventHandler.send(WalletScreenAnalyticsEvent.PushBannerPromo.ButtonAllowPush) if (isNotificationsPermissionGranted()) { updateSubscribeOnPushPermissions(true) } else { walletEventSender.send( event = WalletEvent.RequestPushPermissions( - onAllow = { updateSubscribeOnPushPermissions(true) }, - onDeny = { updateSubscribeOnPushPermissions(false) }, + onAllow = { + updateSubscribeOnPushPermissions(true) + analyticsEventHandler.send( + PushNotificationAnalyticEvents.PermissionStatus(isAllowed = true), + ) + }, + onDeny = { + updateSubscribeOnPushPermissions(false) + analyticsEventHandler.send( + PushNotificationAnalyticEvents.PermissionStatus(isAllowed = false), + ) + }, ), ) } } - override fun onDenyPermissions() = updateSubscribeOnPushPermissions(false) + override fun onDenyPermissions() { + analyticsEventHandler.send(WalletScreenAnalyticsEvent.PushBannerPromo.ButtonLaterPush) + updateSubscribeOnPushPermissions(false) + } private fun updateSubscribeOnPushPermissions(shouldAllow: Boolean) { modelScope.launch { diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/analytics/WalletScreenAnalyticsEvent.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/analytics/WalletScreenAnalyticsEvent.kt index 386d7faea0..6e08203c24 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/analytics/WalletScreenAnalyticsEvent.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/analytics/WalletScreenAnalyticsEvent.kt @@ -144,4 +144,14 @@ sealed class WalletScreenAnalyticsEvent { data object ReferralPromoButtonDismiss : MainScreen(event = "Button - Referral Dismiss") //endregion } + + sealed class PushBannerPromo( + event: String, + params: Map = mapOf(), + ) : AnalyticsEvent(category = "Promo", event = event, params = params) { + + data object PushBanner : PushBannerPromo(event = "Push Banner") + data object ButtonAllowPush : PushBannerPromo(event = "Button - Allow Push") + data object ButtonLaterPush : PushBannerPromo(event = "Button - Later Push") + } } \ No newline at end of file diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/analytics/utils/WalletWarningsAnalyticsSender.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/analytics/utils/WalletWarningsAnalyticsSender.kt index 62e98b08ac..9eaaa739ba 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/analytics/utils/WalletWarningsAnalyticsSender.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/analytics/utils/WalletWarningsAnalyticsSender.kt @@ -6,6 +6,7 @@ import com.tangem.core.analytics.models.AnalyticsParam import com.tangem.core.decompose.di.ModelScoped import com.tangem.domain.tokens.model.analytics.TokenSwapPromoAnalyticsEvent.* import com.tangem.domain.tokens.model.analytics.TokenSwapPromoAnalyticsEvent.Program +import com.tangem.feature.wallet.presentation.wallet.analytics.WalletScreenAnalyticsEvent import com.tangem.feature.wallet.presentation.wallet.analytics.WalletScreenAnalyticsEvent.MainScreen import com.tangem.feature.wallet.presentation.wallet.state.model.WalletNotification import com.tangem.feature.wallet.presentation.wallet.state.model.WalletState @@ -70,7 +71,7 @@ internal class WalletWarningsAnalyticsSender @Inject constructor( -> null is WalletNotification.Critical.SeedPhraseNotification -> MainScreen.NoticeSeedPhraseSupport is WalletNotification.Critical.SeedPhraseSecondNotification -> MainScreen.NoticeSeedPhraseSupportSecond - is WalletNotification.PushNotifications -> null + is WalletNotification.PushNotifications -> WalletScreenAnalyticsEvent.PushBannerPromo.PushBanner } } } \ No newline at end of file