diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 720052668f..a5fdb2e580 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -149,7 +149,6 @@ dependencies { implementation(projects.domain.quotes) implementation(projects.domain.notifications) implementation(projects.domain.notifications.models) - implementation(projects.domain.notifications.toggles) implementation(projects.domain.swap.models) implementation(projects.domain.swap) implementation(projects.domain.walletManager) diff --git a/app/src/main/java/com/tangem/tap/di/domain/NotificationsDomainModule.kt b/app/src/main/java/com/tangem/tap/di/domain/NotificationsDomainModule.kt index b35ae23d95..5e28ca4628 100644 --- a/app/src/main/java/com/tangem/tap/di/domain/NotificationsDomainModule.kt +++ b/app/src/main/java/com/tangem/tap/di/domain/NotificationsDomainModule.kt @@ -1,11 +1,8 @@ package com.tangem.tap.di.domain -import com.tangem.core.configtoggle.feature.FeatureTogglesManager import com.tangem.domain.notifications.* import com.tangem.domain.notifications.repository.NotificationsRepository import com.tangem.domain.notifications.repository.PushNotificationsRepository -import com.tangem.domain.notifications.toggles.NotificationsFeatureToggles -import com.tangem.tap.domain.notifications.DefaultNotificationsFeatureToggles import com.tangem.utils.notifications.PushNotificationsTokenProvider import dagger.Module import dagger.Provides @@ -79,12 +76,6 @@ internal object NotificationsDomainModule { ) } - @Provides - @Singleton - fun provideNotificationsFeatureToggles(featureTogglesManager: FeatureTogglesManager): NotificationsFeatureToggles { - return DefaultNotificationsFeatureToggles(featureTogglesManager = featureTogglesManager) - } - @Provides @Singleton fun provideGetNetworksAvailableForNotifications( diff --git a/app/src/main/java/com/tangem/tap/domain/notifications/DefaultNotificationsFeatureToggles.kt b/app/src/main/java/com/tangem/tap/domain/notifications/DefaultNotificationsFeatureToggles.kt deleted file mode 100644 index 5a58923bb9..0000000000 --- a/app/src/main/java/com/tangem/tap/domain/notifications/DefaultNotificationsFeatureToggles.kt +++ /dev/null @@ -1,11 +0,0 @@ -package com.tangem.tap.domain.notifications - -import com.tangem.core.configtoggle.feature.FeatureTogglesManager -import com.tangem.domain.notifications.toggles.NotificationsFeatureToggles - -internal class DefaultNotificationsFeatureToggles( - private val featureTogglesManager: FeatureTogglesManager, -) : NotificationsFeatureToggles { - override val isNotificationsEnabled: Boolean - get() = featureTogglesManager.isFeatureEnabled("PUSH_NOTIFICATIONS_ENABLED") -} \ No newline at end of file diff --git a/app/src/main/java/com/tangem/tap/features/main/MainViewModel.kt b/app/src/main/java/com/tangem/tap/features/main/MainViewModel.kt index 777ff7cc9a..5fba945d69 100644 --- a/app/src/main/java/com/tangem/tap/features/main/MainViewModel.kt +++ b/app/src/main/java/com/tangem/tap/features/main/MainViewModel.kt @@ -28,7 +28,6 @@ import com.tangem.domain.models.wallet.UserWallet import com.tangem.domain.notifications.GetApplicationIdUseCase import com.tangem.domain.notifications.SendPushTokenUseCase import com.tangem.domain.notifications.models.ApplicationId -import com.tangem.domain.notifications.toggles.NotificationsFeatureToggles import com.tangem.domain.onboarding.repository.OnboardingRepository import com.tangem.domain.onramp.FetchHotCryptoUseCase import com.tangem.domain.promo.GetStoryContentUseCase @@ -80,7 +79,6 @@ internal class MainViewModel @Inject constructor( private val imagePreloader: ImagePreloader, private val fetchHotCryptoUseCase: FetchHotCryptoUseCase, private val onboardingRepository: OnboardingRepository, - private val notificationsToggles: NotificationsFeatureToggles, private val getApplicationIdUseCase: GetApplicationIdUseCase, private val subscribeOnWalletsUseCase: GetSavedWalletsCountUseCase, private val associateWalletsWithApplicationIdUseCase: AssociateWalletsWithApplicationIdUseCase, @@ -415,18 +413,20 @@ internal class MainViewModel @Inject constructor( } private suspend fun initPushNotifications() { - if (notificationsToggles.isNotificationsEnabled) { - getApplicationIdUseCase().onRight { applicationId -> + getApplicationIdUseCase() + .onRight { applicationId -> sendPushTokenUseCase(applicationId = applicationId) associateWalletsWithApplicationId(applicationId = applicationId) updateRemoteWalletsInfoUseCase(applicationId = applicationId) - }.onLeft { Timber.e(it.toString()) } - } + } + .onLeft(Timber::e) } private fun associateWalletsWithApplicationId(applicationId: ApplicationId) { - subscribeOnWalletsUseCase().onEach { wallets -> - associateWalletsWithApplicationIdUseCase(applicationId, wallets) - }.launchIn(viewModelScope) + subscribeOnWalletsUseCase() + .onEach { wallets -> + associateWalletsWithApplicationIdUseCase(applicationId, wallets) + } + .launchIn(viewModelScope) } } \ No newline at end of file diff --git a/core/config-toggles/src/main/assets/configs/feature_toggles_config.json b/core/config-toggles/src/main/assets/configs/feature_toggles_config.json index 89dcd4edea..ec0d4d8507 100644 --- a/core/config-toggles/src/main/assets/configs/feature_toggles_config.json +++ b/core/config-toggles/src/main/assets/configs/feature_toggles_config.json @@ -23,10 +23,6 @@ "name": "WALLET_CONNECT_REDESIGN_ENABLED", "version": "5.27.0" }, - { - "name": "PUSH_NOTIFICATIONS_ENABLED", - "version": "5.26.2" - }, { "name": "USEDESK_ENABLED", "version": "undefined" diff --git a/data/common/build.gradle.kts b/data/common/build.gradle.kts index 6402820dd1..ece3e5297a 100644 --- a/data/common/build.gradle.kts +++ b/data/common/build.gradle.kts @@ -25,7 +25,6 @@ dependencies { implementation(projects.domain.models) implementation(projects.domain.tokens.models) implementation(projects.domain.wallets.models) - implementation(projects.domain.notifications.toggles) implementation(projects.domain.networks) implementation(projects.domain.wallets) diff --git a/data/common/src/main/kotlin/com/tangem/data/common/currency/UserTokensResponseAddressesEnricher.kt b/data/common/src/main/kotlin/com/tangem/data/common/currency/UserTokensResponseAddressesEnricher.kt index 96f45165c5..2b155a84fc 100644 --- a/data/common/src/main/kotlin/com/tangem/data/common/currency/UserTokensResponseAddressesEnricher.kt +++ b/data/common/src/main/kotlin/com/tangem/data/common/currency/UserTokensResponseAddressesEnricher.kt @@ -5,7 +5,6 @@ import com.tangem.domain.models.network.NetworkStatus import com.tangem.domain.models.wallet.UserWalletId import com.tangem.domain.networks.multi.MultiNetworkStatusProducer import com.tangem.domain.networks.multi.MultiNetworkStatusSupplier -import com.tangem.domain.notifications.toggles.NotificationsFeatureToggles import com.tangem.domain.wallets.repository.WalletsRepository import com.tangem.utils.coroutines.CoroutineDispatcherProvider import kotlinx.coroutines.flow.first @@ -15,17 +14,12 @@ import javax.inject.Inject import kotlin.time.Duration.Companion.seconds class UserTokensResponseAddressesEnricher @Inject constructor( - private val notificationsFeatureToggles: NotificationsFeatureToggles, private val walletsRepository: WalletsRepository, private val dispatchers: CoroutineDispatcherProvider, private val multiNetworkStatusSupplier: MultiNetworkStatusSupplier, ) { suspend operator fun invoke(userWalletId: UserWalletId, response: UserTokensResponse): UserTokensResponse { - if (!notificationsFeatureToggles.isNotificationsEnabled) { - return response - } - val isNotificationsEnabled = walletsRepository.isNotificationsEnabled(userWalletId) return withContext(dispatchers.default) { diff --git a/data/common/src/main/kotlin/com/tangem/data/common/di/DataCommonModule.kt b/data/common/src/main/kotlin/com/tangem/data/common/di/DataCommonModule.kt index 2e6266a009..85260e75da 100644 --- a/data/common/src/main/kotlin/com/tangem/data/common/di/DataCommonModule.kt +++ b/data/common/src/main/kotlin/com/tangem/data/common/di/DataCommonModule.kt @@ -9,7 +9,6 @@ import com.tangem.datasource.local.token.UserTokensResponseStore import com.tangem.datasource.local.userwallet.UserWalletsStore import com.tangem.domain.demo.models.DemoConfig import com.tangem.domain.networks.multi.MultiNetworkStatusSupplier -import com.tangem.domain.notifications.toggles.NotificationsFeatureToggles import com.tangem.domain.wallets.repository.WalletsRepository import com.tangem.utils.coroutines.CoroutineDispatcherProvider import dagger.Module @@ -42,13 +41,11 @@ internal object DataCommonModule { @Provides @Singleton fun provideUserTokensEncricher( - notificationsFeatureToggles: NotificationsFeatureToggles, walletsRepository: WalletsRepository, multiNetworkStatusSupplier: MultiNetworkStatusSupplier, dispatchers: CoroutineDispatcherProvider, ): UserTokensResponseAddressesEnricher { return UserTokensResponseAddressesEnricher( - notificationsFeatureToggles = notificationsFeatureToggles, walletsRepository = walletsRepository, multiNetworkStatusSupplier = multiNetworkStatusSupplier, dispatchers = dispatchers, diff --git a/data/common/src/test/kotlin/com/tangem/data/common/currency/UserTokensResponseAddressesEnricherTest.kt b/data/common/src/test/kotlin/com/tangem/data/common/currency/UserTokensResponseAddressesEnricherTest.kt index faf985a7b2..aed68d658d 100644 --- a/data/common/src/test/kotlin/com/tangem/data/common/currency/UserTokensResponseAddressesEnricherTest.kt +++ b/data/common/src/test/kotlin/com/tangem/data/common/currency/UserTokensResponseAddressesEnricherTest.kt @@ -7,7 +7,6 @@ import com.tangem.domain.models.network.NetworkAddress import com.tangem.domain.models.network.NetworkStatus import com.tangem.domain.models.wallet.UserWalletId import com.tangem.domain.networks.multi.MultiNetworkStatusSupplier -import com.tangem.domain.notifications.toggles.NotificationsFeatureToggles import com.tangem.domain.wallets.repository.WalletsRepository import com.tangem.utils.coroutines.CoroutineDispatcherProvider import com.tangem.utils.coroutines.TestingCoroutineDispatcherProvider @@ -23,7 +22,6 @@ import org.junit.Test class UserTokensResponseAddressesEnricherTest { - private lateinit var notificationsFeatureToggles: NotificationsFeatureToggles private lateinit var walletsRepository: WalletsRepository private val dispatchers: CoroutineDispatcherProvider = TestingCoroutineDispatcherProvider() private lateinit var multiNetworkStatusSupplier: MultiNetworkStatusSupplier @@ -31,12 +29,10 @@ class UserTokensResponseAddressesEnricherTest { @Before fun setup() { - notificationsFeatureToggles = mockk() walletsRepository = mockk() multiNetworkStatusSupplier = mockk() enricher = UserTokensResponseAddressesEnricher( - notificationsFeatureToggles = notificationsFeatureToggles, walletsRepository = walletsRepository, dispatchers = dispatchers, multiNetworkStatusSupplier = multiNetworkStatusSupplier, @@ -54,7 +50,6 @@ class UserTokensResponseAddressesEnricherTest { val userWalletId = UserWalletId("1234567890abcdef") val token = createToken() val response = createUserTokensResponse(tokens = listOf(token)) - every { notificationsFeatureToggles.isNotificationsEnabled } returns false // WHEN val result = enricher(userWalletId, response) @@ -70,7 +65,6 @@ class UserTokensResponseAddressesEnricherTest { val userWalletId = UserWalletId("1234567890abcdef") val token = createToken() val response = createUserTokensResponse(tokens = listOf(token)) - every { notificationsFeatureToggles.isNotificationsEnabled } returns true coEvery { walletsRepository.isNotificationsEnabled(userWalletId) } returns false coEvery { multiNetworkStatusSupplier.invoke(any()) @@ -110,7 +104,6 @@ class UserTokensResponseAddressesEnricherTest { val response = createUserTokensResponse(tokens = listOf(token)) val addresses = listOf("0x123", "0x456") - every { notificationsFeatureToggles.isNotificationsEnabled } returns true coEvery { walletsRepository.isNotificationsEnabled(userWalletId) } returns true coEvery { multiNetworkStatusSupplier.invoke(any()) @@ -152,7 +145,6 @@ class UserTokensResponseAddressesEnricherTest { val token = createToken() val response = createUserTokensResponse(tokens = listOf(token)) - every { notificationsFeatureToggles.isNotificationsEnabled } returns true coEvery { walletsRepository.isNotificationsEnabled(userWalletId) } returns true coEvery { multiNetworkStatusSupplier.invoke(any()) diff --git a/domain/notifications/toggles/.gitignore b/domain/notifications/toggles/.gitignore deleted file mode 100644 index 42afabfd2a..0000000000 --- a/domain/notifications/toggles/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build \ No newline at end of file diff --git a/domain/notifications/toggles/build.gradle.kts b/domain/notifications/toggles/build.gradle.kts deleted file mode 100644 index 7ff7fb7522..0000000000 --- a/domain/notifications/toggles/build.gradle.kts +++ /dev/null @@ -1,4 +0,0 @@ -plugins { - alias(deps.plugins.kotlin.jvm) - id("configuration") -} \ No newline at end of file diff --git a/domain/notifications/toggles/src/main/java/com/tangem/domain/notifications/toggles/NotificationsFeatureToggles.kt b/domain/notifications/toggles/src/main/java/com/tangem/domain/notifications/toggles/NotificationsFeatureToggles.kt deleted file mode 100644 index 22bbec7d10..0000000000 --- a/domain/notifications/toggles/src/main/java/com/tangem/domain/notifications/toggles/NotificationsFeatureToggles.kt +++ /dev/null @@ -1,5 +0,0 @@ -package com.tangem.domain.notifications.toggles - -interface NotificationsFeatureToggles { - val isNotificationsEnabled: Boolean -} \ No newline at end of file diff --git a/features/push-notifications/impl/build.gradle.kts b/features/push-notifications/impl/build.gradle.kts index 2f2c875648..e8a673832e 100644 --- a/features/push-notifications/impl/build.gradle.kts +++ b/features/push-notifications/impl/build.gradle.kts @@ -40,7 +40,6 @@ dependencies { /** Domain module */ implementation(projects.domain.settings) - implementation(projects.domain.notifications.toggles) implementation(projects.domain.notifications) /** Feature modules */ diff --git a/features/push-notifications/impl/src/main/java/com/tangem/features/pushnotifications/impl/DefaultPushNotificationsBottomSheetComponent.kt b/features/push-notifications/impl/src/main/java/com/tangem/features/pushnotifications/impl/DefaultPushNotificationsBottomSheetComponent.kt index 259b0bacf0..2862913418 100644 --- a/features/push-notifications/impl/src/main/java/com/tangem/features/pushnotifications/impl/DefaultPushNotificationsBottomSheetComponent.kt +++ b/features/push-notifications/impl/src/main/java/com/tangem/features/pushnotifications/impl/DefaultPushNotificationsBottomSheetComponent.kt @@ -1,8 +1,6 @@ package com.tangem.features.pushnotifications.impl import androidx.compose.runtime.Composable -import androidx.compose.runtime.collectAsState -import androidx.compose.runtime.getValue import androidx.compose.runtime.remember import com.tangem.core.decompose.context.AppComponentContext import com.tangem.core.decompose.model.getOrCreateModel @@ -38,7 +36,6 @@ internal class DefaultPushNotificationsBottomSheetComponent @AssistedInject cons @Composable override fun BottomSheet() { - val state by model.state.collectAsState() val bottomSheetConfig = remember(key1 = this) { TangemBottomSheetConfig( isShown = true, @@ -55,7 +52,6 @@ internal class DefaultPushNotificationsBottomSheetComponent @AssistedInject cons onLaterClick = model::onLaterClick, onAllowPermission = model::onAllowPermission, onDenyPermission = model::onDenyPermission, - showNotificationsInfo = state.showInfoAboutNotifications, ) } } diff --git a/features/push-notifications/impl/src/main/java/com/tangem/features/pushnotifications/impl/DefaultPushNotificationsComponent.kt b/features/push-notifications/impl/src/main/java/com/tangem/features/pushnotifications/impl/DefaultPushNotificationsComponent.kt index 458d977d4e..3eb2a6fdc9 100644 --- a/features/push-notifications/impl/src/main/java/com/tangem/features/pushnotifications/impl/DefaultPushNotificationsComponent.kt +++ b/features/push-notifications/impl/src/main/java/com/tangem/features/pushnotifications/impl/DefaultPushNotificationsComponent.kt @@ -2,8 +2,6 @@ package com.tangem.features.pushnotifications.impl import androidx.activity.compose.BackHandler import androidx.compose.runtime.Composable -import androidx.compose.runtime.collectAsState -import androidx.compose.runtime.getValue import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import com.tangem.core.decompose.context.AppComponentContext @@ -28,15 +26,15 @@ internal class DefaultPushNotificationsComponent @AssistedInject constructor( @Composable override fun Content(modifier: Modifier) { val activity = LocalContext.current.findActivity() - val state by model.state.collectAsState() + BackHandler(onBack = { activity.finish() }) NavigationBar3ButtonsScrim() + PushNotificationsScreen( onAllowClick = model::onAllowClick, onLaterClick = model::onLaterClick, onAllowPermission = model::onAllowPermission, onDenyPermission = model::onDenyPermission, - showNotificationsInfo = state.showInfoAboutNotifications, ) } diff --git a/features/push-notifications/impl/src/main/java/com/tangem/features/pushnotifications/impl/model/PushNotificationsModel.kt b/features/push-notifications/impl/src/main/java/com/tangem/features/pushnotifications/impl/model/PushNotificationsModel.kt index c76c250f14..bd3edb7000 100644 --- a/features/push-notifications/impl/src/main/java/com/tangem/features/pushnotifications/impl/model/PushNotificationsModel.kt +++ b/features/push-notifications/impl/src/main/java/com/tangem/features/pushnotifications/impl/model/PushNotificationsModel.kt @@ -9,16 +9,12 @@ import com.tangem.core.decompose.di.ModelScoped import com.tangem.core.decompose.model.Model import com.tangem.core.decompose.model.ParamsContainer import com.tangem.domain.notifications.repository.NotificationsRepository -import com.tangem.domain.notifications.toggles.NotificationsFeatureToggles import com.tangem.domain.settings.NeverRequestPermissionUseCase import com.tangem.domain.settings.NeverToInitiallyAskPermissionUseCase import com.tangem.features.pushnotifications.api.PushNotificationsParams import com.tangem.features.pushnotifications.api.analytics.PushNotificationAnalyticEvents import com.tangem.features.pushnotifications.api.utils.PUSH_PERMISSION -import com.tangem.features.pushnotifications.impl.presentation.state.PushNotificationsUM import com.tangem.utils.coroutines.CoroutineDispatcherProvider -import kotlinx.coroutines.flow.MutableStateFlow -import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.launch import javax.inject.Inject @@ -32,7 +28,6 @@ internal class PushNotificationsModel @Inject constructor( private val neverToInitiallyAskPermissionUseCase: NeverToInitiallyAskPermissionUseCase, private val appRouter: AppRouter, private val analyticHandler: AnalyticsEventHandler, - private val notificationsFeatureToggles: NotificationsFeatureToggles, private val notificationsRepository: NotificationsRepository, ) : Model(), PushNotificationsClickIntents { @@ -43,32 +38,21 @@ internal class PushNotificationsModel @Inject constructor( AppRoute.PushNotification.Source.Onboarding -> AnalyticsParam.ScreensSources.Onboarding } - private val _state = MutableStateFlow( - PushNotificationsUM( - showInfoAboutNotifications = notificationsFeatureToggles.isNotificationsEnabled, - ), - ) - init { analyticHandler.send(PushNotificationAnalyticEvents.NotificationsScreenOpened(source)) } - val state = _state.asStateFlow() - override fun onAllowClick() { - if (notificationsFeatureToggles.isNotificationsEnabled) { - modelScope.launch { - notificationsRepository.setUserAllowToSubscribeOnPushNotifications(true) - } + modelScope.launch { + notificationsRepository.setUserAllowToSubscribeOnPushNotifications(true) } + analyticHandler.send(PushNotificationAnalyticEvents.ButtonAllow(source)) } override fun onLaterClick() { - if (notificationsFeatureToggles.isNotificationsEnabled) { - modelScope.launch { - notificationsRepository.setUserAllowToSubscribeOnPushNotifications(false) - } + modelScope.launch { + notificationsRepository.setUserAllowToSubscribeOnPushNotifications(false) } analyticHandler.send(PushNotificationAnalyticEvents.ButtonLater(source)) modelScope.launch { diff --git a/features/push-notifications/impl/src/main/java/com/tangem/features/pushnotifications/impl/presentation/state/PushNotificationsUM.kt b/features/push-notifications/impl/src/main/java/com/tangem/features/pushnotifications/impl/presentation/state/PushNotificationsUM.kt deleted file mode 100644 index a7161b630b..0000000000 --- a/features/push-notifications/impl/src/main/java/com/tangem/features/pushnotifications/impl/presentation/state/PushNotificationsUM.kt +++ /dev/null @@ -1,5 +0,0 @@ -package com.tangem.features.pushnotifications.impl.presentation.state - -data class PushNotificationsUM( - val showInfoAboutNotifications: Boolean = false, -) \ No newline at end of file diff --git a/features/push-notifications/impl/src/main/java/com/tangem/features/pushnotifications/impl/presentation/ui/PushNotificationsBottomSheet.kt b/features/push-notifications/impl/src/main/java/com/tangem/features/pushnotifications/impl/presentation/ui/PushNotificationsBottomSheet.kt index fa78628411..07090215d9 100644 --- a/features/push-notifications/impl/src/main/java/com/tangem/features/pushnotifications/impl/presentation/ui/PushNotificationsBottomSheet.kt +++ b/features/push-notifications/impl/src/main/java/com/tangem/features/pushnotifications/impl/presentation/ui/PushNotificationsBottomSheet.kt @@ -44,7 +44,6 @@ internal fun PushNotificationsContent( onLaterClick: () -> Unit, onAllowPermission: () -> Unit, onDenyPermission: () -> Unit, - showNotificationsInfo: Boolean, ) { val requestPushPermission = requestPermission( onAllow = onAllowPermission, @@ -65,18 +64,11 @@ internal fun PushNotificationsContent( R.drawable.ic_storefront_24, resourceReference(R.string.user_push_notification_agreement_argument_two), ), - ).let { baseItems -> - if (showNotificationsInfo) { - baseItems.add( - ShowcaseItemModel( - R.drawable.ic_notifications_24, - resourceReference(R.string.user_push_notification_agreement_argument_three), - ), - ) - } else { - baseItems - } - }, + ShowcaseItemModel( + R.drawable.ic_notifications_24, + resourceReference(R.string.user_push_notification_agreement_argument_three), + ), + ), modifier = Modifier.padding(top = TangemTheme.dimens.spacing40), ) SpacerH28() @@ -111,7 +103,6 @@ private fun Preview_PushNotificationsBottomSheet() { onLaterClick = {}, onAllowPermission = {}, onDenyPermission = {}, - showNotificationsInfo = true, ) } } diff --git a/features/push-notifications/impl/src/main/java/com/tangem/features/pushnotifications/impl/presentation/ui/PushNotificationsScreen.kt b/features/push-notifications/impl/src/main/java/com/tangem/features/pushnotifications/impl/presentation/ui/PushNotificationsScreen.kt index 4750463f50..81ec2b2743 100644 --- a/features/push-notifications/impl/src/main/java/com/tangem/features/pushnotifications/impl/presentation/ui/PushNotificationsScreen.kt +++ b/features/push-notifications/impl/src/main/java/com/tangem/features/pushnotifications/impl/presentation/ui/PushNotificationsScreen.kt @@ -18,7 +18,6 @@ internal fun PushNotificationsScreen( onLaterClick: () -> Unit, onAllowPermission: () -> Unit, onDenyPermission: () -> Unit, - showNotificationsInfo: Boolean, ) { val requestPushPermission = requestPermission( onAllow = onAllowPermission, @@ -38,18 +37,11 @@ internal fun PushNotificationsScreen( R.drawable.ic_storefront_24, resourceReference(R.string.user_push_notification_agreement_argument_two), ), - ).let { baseItems -> - if (showNotificationsInfo) { - baseItems.add( - ShowcaseItemModel( - R.drawable.ic_notifications_24, - resourceReference(R.string.user_push_notification_agreement_argument_three), - ), - ) - } else { - baseItems - } - }, + ShowcaseItemModel( + R.drawable.ic_notifications_24, + resourceReference(R.string.user_push_notification_agreement_argument_three), + ), + ), primaryButton = ShowcaseButtonModel( buttonText = resourceReference(R.string.common_allow), onClick = { diff --git a/features/wallet-settings/impl/build.gradle.kts b/features/wallet-settings/impl/build.gradle.kts index 4ab6bc0a40..3bb8904189 100644 --- a/features/wallet-settings/impl/build.gradle.kts +++ b/features/wallet-settings/impl/build.gradle.kts @@ -41,7 +41,6 @@ dependencies { implementation(projects.domain.demo) implementation(projects.domain.nft) implementation(projects.domain.settings) - implementation(projects.domain.notifications.toggles) implementation(projects.domain.notifications.models) implementation(projects.domain.notifications) diff --git a/features/wallet-settings/impl/src/main/kotlin/com/tangem/feature/walletsettings/model/WalletSettingsModel.kt b/features/wallet-settings/impl/src/main/kotlin/com/tangem/feature/walletsettings/model/WalletSettingsModel.kt index 5eba834c7e..fac9ee92d6 100644 --- a/features/wallet-settings/impl/src/main/kotlin/com/tangem/feature/walletsettings/model/WalletSettingsModel.kt +++ b/features/wallet-settings/impl/src/main/kotlin/com/tangem/feature/walletsettings/model/WalletSettingsModel.kt @@ -32,7 +32,6 @@ import com.tangem.domain.nft.EnableWalletNFTUseCase import com.tangem.domain.nft.GetWalletNFTEnabledUseCase import com.tangem.domain.notifications.GetIsHuaweiDeviceWithoutGoogleServicesUseCase import com.tangem.domain.notifications.repository.NotificationsRepository -import com.tangem.domain.notifications.toggles.NotificationsFeatureToggles import com.tangem.domain.settings.repositories.PermissionRepository import com.tangem.domain.wallets.usecase.* import com.tangem.feature.walletsettings.analytics.Settings @@ -73,7 +72,6 @@ internal class WalletSettingsModel @Inject constructor( getWalletNFTEnabledUseCase: GetWalletNFTEnabledUseCase, private val enableWalletNFTUseCase: EnableWalletNFTUseCase, private val disableWalletNFTUseCase: DisableWalletNFTUseCase, - private val notificationsToggles: NotificationsFeatureToggles, getWalletNotificationsEnabledUseCase: GetWalletNotificationsEnabledUseCase, private val setNotificationsEnabledUseCase: SetNotificationsEnabledUseCase, private val settingsManager: SettingsManager, @@ -130,8 +128,7 @@ internal class WalletSettingsModel @Inject constructor( is UserWallet.Hot -> wallet.backedUp is UserWallet.Cold -> true } - val isNeedShowNotifications = notificationsToggles.isNotificationsEnabled && - !getIsHuaweiDeviceWithoutGoogleServicesUseCase() + val isNeedShowNotifications = !getIsHuaweiDeviceWithoutGoogleServicesUseCase() state.update { value -> value.copy( items = buildItems( diff --git a/features/wallet/impl/build.gradle.kts b/features/wallet/impl/build.gradle.kts index 1df9de0f95..daafa8122d 100644 --- a/features/wallet/impl/build.gradle.kts +++ b/features/wallet/impl/build.gradle.kts @@ -95,7 +95,6 @@ dependencies { implementation(projects.domain.wallets) implementation(projects.domain.wallets.models) implementation(projects.domain.notifications) - implementation(projects.domain.notifications.toggles) implementation(projects.domain.transaction) /** Feature Apis */ diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/child/wallet/model/WalletModel.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/child/wallet/model/WalletModel.kt index 7e4574513d..b72ac8cf5c 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/child/wallet/model/WalletModel.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/child/wallet/model/WalletModel.kt @@ -17,7 +17,6 @@ import com.tangem.domain.models.wallet.isMultiCurrency import com.tangem.domain.nft.ObserveAndClearNFTCacheIfNeedUseCase import com.tangem.domain.notifications.GetIsHuaweiDeviceWithoutGoogleServicesUseCase import com.tangem.domain.notifications.repository.NotificationsRepository -import com.tangem.domain.notifications.toggles.NotificationsFeatureToggles import com.tangem.domain.settings.* import com.tangem.domain.tokens.RefreshMultiCurrencyWalletQuotesUseCase import com.tangem.domain.wallets.usecase.* @@ -79,7 +78,6 @@ internal class WalletModel @Inject constructor( private val notificationsRepository: NotificationsRepository, private val getWalletsListForEnablingUseCase: GetWalletsForAutomaticallyPushEnablingUseCase, private val setNotificationsEnabledUseCase: SetNotificationsEnabledUseCase, - private val notificationsFeatureToggles: NotificationsFeatureToggles, private val shouldSaveUserWalletsSyncUseCase: ShouldSaveUserWalletsSyncUseCase, private val getIsHuaweiDeviceWithoutGoogleServicesUseCase: GetIsHuaweiDeviceWithoutGoogleServicesUseCase, val screenLifecycleProvider: ScreenLifecycleProvider, @@ -575,7 +573,6 @@ internal class WalletModel @Inject constructor( } private fun enableNotificationsIfNeeded() { - if (!notificationsFeatureToggles.isNotificationsEnabled) return modelScope.launch { val isUserAllowToEnableNotifications = notificationsRepository.isUserAllowToSubscribeOnPushNotifications() if (isUserAllowToEnableNotifications) { diff --git a/settings.gradle.kts b/settings.gradle.kts index 1511ce8a21..19c6d1c875 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -341,7 +341,6 @@ include(":domain:blockaid") include(":domain:blockaid:models") include(":domain:notifications") include(":domain:notifications:models") -include(":domain:notifications:toggles") include(":domain:express") include(":domain:express:models") include(":domain:swap")