From 436a5a115f0de4b0747479e53804688c8b9e7b7d Mon Sep 17 00:00:00 2001 From: Tangem Date: Tue, 29 Jul 2025 18:07:15 +0400 Subject: [PATCH] Updated on 2026-08-14 --- .../datasource/info/AndroidAppInfoProvider.kt | 3 +++ core/res/src/main/res/values-fr/strings.xml | 2 ++ core/res/src/main/res/values-ja/strings.xml | 14 +++++++++++++ core/res/src/main/res/values-ru/strings.xml | 3 +++ .../src/main/res/values-uk-rUA/strings.xml | 2 ++ core/res/src/main/res/values/strings.xml | 13 ++++++++++++ .../com/tangem/utils/info/AppInfoProvider.kt | 1 + .../ShouldShowHuaweiWarningUseCase.kt | 15 +++++++++++++ .../model/WalletSettingsModel.kt | 21 +++++++++++++++++++ 9 files changed, 74 insertions(+) create mode 100644 domain/notifications/src/main/java/com/tangem/domain/notifications/ShouldShowHuaweiWarningUseCase.kt diff --git a/core/datasource/src/main/java/com/tangem/datasource/info/AndroidAppInfoProvider.kt b/core/datasource/src/main/java/com/tangem/datasource/info/AndroidAppInfoProvider.kt index 0bc5462596..d33089ff1b 100644 --- a/core/datasource/src/main/java/com/tangem/datasource/info/AndroidAppInfoProvider.kt +++ b/core/datasource/src/main/java/com/tangem/datasource/info/AndroidAppInfoProvider.kt @@ -21,4 +21,7 @@ internal class AndroidAppInfoProvider @Inject constructor( get() = TimeZone.getDefault().id override val appVersion: String get() = appVersionProvider.versionName + override val isHuaweiDevice: Boolean + get() = Build.MANUFACTURER.equals("HUAWEI", ignoreCase = true) || + Build.BRAND.equals("HUAWEI", ignoreCase = true) } \ No newline at end of file diff --git a/core/res/src/main/res/values-fr/strings.xml b/core/res/src/main/res/values-fr/strings.xml index 5d857cb793..075f05f465 100644 --- a/core/res/src/main/res/values-fr/strings.xml +++ b/core/res/src/main/res/values-fr/strings.xml @@ -1087,6 +1087,8 @@ de : %s à : %s validateur : %s + Les notifications sont activées, mais elles ne fonctionneront pas tant que vous n\'aurez pas autorisé les notifications dans les paramètres de votre appareil. + Notifications de transaction Minimum %s Le montant minimum pour effectuer cette transaction est %1$s. Réessayez diff --git a/core/res/src/main/res/values-ja/strings.xml b/core/res/src/main/res/values-ja/strings.xml index 7af3b7a089..af6731c66e 100644 --- a/core/res/src/main/res/values-ja/strings.xml +++ b/core/res/src/main/res/values-ja/strings.xml @@ -61,6 +61,13 @@ システムのデフォルト テーマ アプリ設定 + ウォレットを追加 + ログインするウォレットを選択する + お帰りなさい! + + %d 枚のカード + + スマートフォンウォレット ウォレットのバックアップが正常に完了しました。 これらの単語は紛失した場合、復元できません。必ず安全な場所に保管してください。 バックアップが完了しました @@ -846,6 +853,7 @@ %1$s 、 %2$s 宛先タグ アドレスを入力 + ENS名またはアドレスを入力 アドレスはウォレットアドレスと同じです 最低額は%sです 最小の変更は%sです @@ -927,11 +935,15 @@ 無効な金額 手数料が残高を超えています 合計金額が残高を超えています + トークンを変更してもよろしいですか? 変更後、以前のデータはリセットされます。 + トークンの変更 スワップして送信 トークンを送信すれば、送信中に変換されます。受信者は必要なものをシームレスに受け取ります。 受信者は受け取ります 受信者に送信されます 受取金額 + 変換をキャンセルしてもよろしいですか? 変更後、以前のデータはリセットされます。 + キャンセルの確認 スワップして送信 取引が送信されました 設定したいカードまたはリングをスキャンするために準備してください。 @@ -1428,6 +1440,8 @@ 取引リクエスト 取引リクエスト 無制限 + 各ペアリング試行で、新しくユニークなURIが使用されていることを確認します + URIはすでに使用されています ウォレットコネクト 破棄 バックアップが中断されました。再開しますか? diff --git a/core/res/src/main/res/values-ru/strings.xml b/core/res/src/main/res/values-ru/strings.xml index 071f03c35f..5a430645a7 100644 --- a/core/res/src/main/res/values-ru/strings.xml +++ b/core/res/src/main/res/values-ru/strings.xml @@ -1105,6 +1105,8 @@ от: %s на: %s валидатор: %s + Уведомления включены, но не будут работать, пока вы не разрешите их в настройках устройства. + Уведомления о транзакциях Минимум %s Минимальная сумма транзакции равна %1$s. Комиссии сети Tron для популярных токенов могут быть выше. Стейкинг TRX может помочь снизить расходы на транзакции. @@ -1182,6 +1184,7 @@ Получите доступ к более чем 13 000 криптовалют. Покупайте, продавайте, обменивайте и стейкайте в один клик. Свяжите до трех карт для резервного копирования. Откройте Tangem Wallet Получайте уведомления о входящих транзакциях в кошельке и обновлениях Tangem. + В настоящий момент push-уведомления могут не работать на устройствах Huawei. Мы уже работаем над решением этой проблемы и планируем исправление в ближайших обновлениях. Спасибо за понимание! Уведомления о транзакциях Настройки кошелька Tangem diff --git a/core/res/src/main/res/values-uk-rUA/strings.xml b/core/res/src/main/res/values-uk-rUA/strings.xml index fe103942ab..9b3e3dfe52 100644 --- a/core/res/src/main/res/values-uk-rUA/strings.xml +++ b/core/res/src/main/res/values-uk-rUA/strings.xml @@ -1105,6 +1105,8 @@ від: %s до: %s валідатор: %s + Сповіщення ввімкнені, але не працюватимуть, доки ви не дозволите їх у налаштуваннях пристрою. + Сповіщення про транзакції Мінімум %s Мінімальна сума транзакції становить %1$s. Комісії мережі Tron для популярних токенів можуть бути вищими. Стейкінг TRX може допомогти знизити транзакційні витрати. diff --git a/core/res/src/main/res/values/strings.xml b/core/res/src/main/res/values/strings.xml index 2ee799d6f3..a8961f599c 100644 --- a/core/res/src/main/res/values/strings.xml +++ b/core/res/src/main/res/values/strings.xml @@ -64,6 +64,10 @@ Add Wallet Select a wallet to log in Welcome back! + + %d card + %d cards + Phone Wallet You successfully backed up your wallet. These words can’t be recovered if lost. Make sure to keep it somewhere secure. @@ -426,6 +430,7 @@ To complete setup, back up your wallet and secure app access with a Access Code. Finish Now Finish Wallet Activation + To complete setup, secure app access with Access Code. Recover an existing wallet stored in your Google Drive backup Google Drive Backup Go to backup @@ -866,6 +871,7 @@ %1$s, %2$s Destination Tag Enter address + Enter ENS name or address Address is the same as wallet address Minimum amount is %s Minimum change is %s @@ -947,11 +953,15 @@ Invalid amount Fee exceeds balance Total amount exceeds balance + Are you sure you want to change the token? After changing, previous data will be reset. + Changing token Swap and send Send any token, and we’ll convert it on the way. Your recipient gets exactly what they need—seamlessly. Recipient will receive Will be sent a recipient Amount to receive + Are you sure you want to cancel the conversion? After changing, previous data will be reset. + Confirm cancelation Send with swap Transaction sent Prepare to scan card or ring you want to set up. @@ -1341,6 +1351,7 @@ Secret code to protect this wallet. Used for login and signatures. Set/Change Access Code Stay notified on wallet incoming transactions and Tangem updates. + Push notifications may currently not work on Huawei devices. We\'re actively working on a solution and will release a fix in an upcoming update. Thank you for your understanding! Transaction Notifications Wallet settings Tangem @@ -1497,6 +1508,8 @@ Transaction request Transaction request Unlimited Amount + Ensure that each pairing attempt uses a fresh and unique URI + URI already used Wallet connect Discard You have an interrupted backup. Do you want to resume? diff --git a/core/utils/src/main/java/com/tangem/utils/info/AppInfoProvider.kt b/core/utils/src/main/java/com/tangem/utils/info/AppInfoProvider.kt index 0ab3e32398..7337a4f114 100644 --- a/core/utils/src/main/java/com/tangem/utils/info/AppInfoProvider.kt +++ b/core/utils/src/main/java/com/tangem/utils/info/AppInfoProvider.kt @@ -7,4 +7,5 @@ interface AppInfoProvider { val language: String val timezone: String val appVersion: String + val isHuaweiDevice: Boolean } \ No newline at end of file diff --git a/domain/notifications/src/main/java/com/tangem/domain/notifications/ShouldShowHuaweiWarningUseCase.kt b/domain/notifications/src/main/java/com/tangem/domain/notifications/ShouldShowHuaweiWarningUseCase.kt new file mode 100644 index 0000000000..2e7c8ffbde --- /dev/null +++ b/domain/notifications/src/main/java/com/tangem/domain/notifications/ShouldShowHuaweiWarningUseCase.kt @@ -0,0 +1,15 @@ +package com.tangem.domain.notifications + +import com.tangem.utils.info.AppInfoProvider +import com.tangem.utils.notifications.PushNotificationsTokenProvider +import javax.inject.Inject + +class ShouldShowHuaweiWarningUseCase @Inject constructor( + private val appInfoProvider: AppInfoProvider, + private val pushNotificationsTokenProvider: PushNotificationsTokenProvider, +) { + + suspend operator fun invoke(): Boolean { + return appInfoProvider.isHuaweiDevice && pushNotificationsTokenProvider.getToken().isEmpty() + } +} \ No newline at end of file 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 4b62a5e4d7..f2ca439c51 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 @@ -24,6 +24,7 @@ import com.tangem.domain.models.scan.ScanResponse import com.tangem.domain.nft.DisableWalletNFTUseCase import com.tangem.domain.nft.EnableWalletNFTUseCase import com.tangem.domain.nft.GetWalletNFTEnabledUseCase +import com.tangem.domain.notifications.ShouldShowHuaweiWarningUseCase import com.tangem.domain.notifications.repository.NotificationsRepository import com.tangem.domain.notifications.toggles.NotificationsFeatureToggles import com.tangem.domain.settings.repositories.PermissionRepository @@ -74,6 +75,7 @@ internal class WalletSettingsModel @Inject constructor( private val settingsManager: SettingsManager, private val permissionsRepository: PermissionRepository, private val notificationsRepository: NotificationsRepository, + private val shouldShowHuaweiWarningUseCase: ShouldShowHuaweiWarningUseCase, ) : Model() { val params: WalletSettingsComponent.Params = paramsContainer.require() @@ -230,6 +232,10 @@ internal class WalletSettingsModel @Inject constructor( private fun onCheckedNotificationsChange(isChecked: Boolean) { modelScope.launch { if (isChecked) { + if (shouldShowHuaweiWarningUseCase()) { + showHuaweiDialog() + return@launch + } state.update { value -> value.copy( requestPushNotificationsPermission = true, @@ -242,6 +248,21 @@ internal class WalletSettingsModel @Inject constructor( } } + private fun showHuaweiDialog() { + val message = DialogMessage( + message = resourceReference(R.string.wallet_settings_push_notifications_huawei_warning), + firstActionBuilder = { + EventMessageAction( + title = resourceReference(R.string.common_ok), + warning = true, + onClick = {}, + ) + }, + ) + + messageSender.send(message) + } + private fun onNotificationsDescriptionClick() { bottomSheetNavigation.activate(NetworksAvailableForNotificationBSConfig) }