diff --git a/app/src/main/java/com/tangem/tap/common/pushes/TangemPushNotificationService.kt b/app/src/main/java/com/tangem/tap/common/pushes/TangemPushNotificationService.kt index c8dc6dda61..6cf4e25783 100644 --- a/app/src/main/java/com/tangem/tap/common/pushes/TangemPushNotificationService.kt +++ b/app/src/main/java/com/tangem/tap/common/pushes/TangemPushNotificationService.kt @@ -5,7 +5,6 @@ import android.app.NotificationChannel import android.app.NotificationManager import android.app.PendingIntent import android.content.Intent -import android.content.Intent.ACTION_VIEW import android.graphics.Bitmap import android.net.Uri import android.os.Build @@ -18,6 +17,7 @@ import coil.request.ImageRequest import com.google.firebase.messaging.FirebaseMessagingService import com.google.firebase.messaging.RemoteMessage import com.tangem.domain.common.LogConfig +import com.tangem.tap.MainActivity import com.tangem.tap.common.images.createCoilImageLoader import com.tangem.tap.features.intentHandler.handlers.OnPushClickedIntentHandler import com.tangem.wallet.R @@ -37,7 +37,7 @@ internal class TangemPushNotificationService : FirebaseMessagingService() { val notification = message.notification ?: return val channelId = notification.channelId ?: TANGEM_CHANNEL_ID - val intent = Intent(ACTION_VIEW).apply { + val intent = Intent(applicationContext, MainActivity::class.java).apply { data = message.data[DEEPLINK_KEY]?.toUri() putExtra(OnPushClickedIntentHandler.OPENED_FROM_GCM_PUSH, true) addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP) diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/deeplink/WalletDeepLinksHandler.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/deeplink/WalletDeepLinksHandler.kt index 75075d1d24..241307e17c 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/deeplink/WalletDeepLinksHandler.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/deeplink/WalletDeepLinksHandler.kt @@ -8,6 +8,7 @@ import com.tangem.core.deeplink.DeepLinksRegistry import com.tangem.core.deeplink.global.BuyCurrencyDeepLink import com.tangem.core.deeplink.global.ReferralDeepLink import com.tangem.core.deeplink.global.SellCurrencyDeepLink +import com.tangem.domain.common.util.cardTypesResolver import com.tangem.domain.tokens.GetCryptoCurrencyUseCase import com.tangem.domain.tokens.model.analytics.TokenScreenAnalyticsEvent import com.tangem.domain.wallets.models.UserWallet @@ -55,7 +56,7 @@ internal class WalletDeepLinksHandler @Inject constructor( ) return buildList { - addReferralDeepLink(userWallet.walletId) + addReferralDeepLink(userWallet) add(sellCurrencyDeepLink) if (onrampFeatureToggles.isFeatureEnabled || !userWallet.isMultiCurrency) { add( @@ -98,13 +99,15 @@ internal class WalletDeepLinksHandler @Inject constructor( } } - private fun MutableList.addReferralDeepLink(userWalletId: UserWalletId) { + private fun MutableList.addReferralDeepLink(userWallet: UserWallet) { add( ReferralDeepLink( onReceive = { - router.push( - AppRoute.ReferralProgram(userWalletId = userWalletId), - ) + if (userWallet.cardTypesResolver.isTangemWallet()) { + router.push( + AppRoute.ReferralProgram(userWalletId = userWallet.walletId), + ) + } }, ), )