Updated on 2026-08-14

This commit is contained in:
Tangem 2025-10-06 17:36:05 +02:00
parent 7dfff7c34f
commit 4765a7be43
3 changed files with 31 additions and 4 deletions

View file

@ -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 {

View file

@ -144,4 +144,14 @@ sealed class WalletScreenAnalyticsEvent {
data object ReferralPromoButtonDismiss : MainScreen(event = "Button - Referral Dismiss")
//endregion
}
sealed class PushBannerPromo(
event: String,
params: Map<String, String> = 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")
}
}

View file

@ -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
}
}
}