Updated on 2026-08-14

This commit is contained in:
Tangem 2025-07-29 18:07:15 +04:00
parent 9ef9542750
commit 436a5a115f
9 changed files with 74 additions and 0 deletions

View file

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

View file

@ -1087,6 +1087,8 @@
<string name="transaction_history_transaction_from_address">de : %s</string>
<string name="transaction_history_transaction_to_address">à : %s</string>
<string name="transaction_history_transaction_validator">validateur : %s</string>
<string name="transaction_notifications_warning_description">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.</string>
<string name="transaction_notifications_warning_title">Notifications de transaction</string>
<string name="transfer_min_amount_error">Minimum %s</string>
<string name="transfer_notification_invalid_minimum_transaction_amount_text">Le montant minimum pour effectuer cette transaction est %1$s.</string>
<string name="try_to_load_data_again_button_title">Réessayez</string>

View file

@ -61,6 +61,13 @@
<string name="app_settings_theme_mode_system">システムのデフォルト</string>
<string name="app_settings_theme_selector_title">テーマ</string>
<string name="app_settings_title">アプリ設定</string>
<string name="auth_info_add_wallet_title">ウォレットを追加</string>
<string name="auth_info_subtitle">ログインするウォレットを選択する</string>
<string name="auth_info_title">お帰りなさい!</string>
<plurals name="auth_wallet_hardware_description">
<item quantity="other">%d 枚のカード</item>
</plurals>
<string name="auth_wallet_mobile_description">スマートフォンウォレット</string>
<string name="backup_complete_description">ウォレットのバックアップが正常に完了しました。</string>
<string name="backup_complete_seed_description">これらの単語は紛失した場合、復元できません。必ず安全な場所に保管してください。</string>
<string name="backup_complete_title">バックアップが完了しました</string>
@ -846,6 +853,7 @@
<string name="send_date_format">%1$s 、 %2$s</string>
<string name="send_destination_tag_field">宛先タグ</string>
<string name="send_enter_address_field">アドレスを入力</string>
<string name="send_enter_address_field_ens">ENS名またはアドレスを入力</string>
<string name="send_error_address_same_as_wallet">アドレスはウォレットアドレスと同じです</string>
<string name="send_error_dust_amount_format">最低額は%sです</string>
<string name="send_error_dust_change_format">最小の変更は%sです</string>
@ -927,11 +935,15 @@
<string name="send_validation_invalid_amount">無効な金額</string>
<string name="send_validation_invalid_fee">手数料が残高を超えています</string>
<string name="send_validation_invalid_total">合計金額が残高を超えています</string>
<string name="send_with_swap_change_token_alert_message">トークンを変更してもよろしいですか? 変更後、以前のデータはリセットされます。</string>
<string name="send_with_swap_change_token_alert_title">トークンの変更</string>
<string name="send_with_swap_confirm_title">スワップして送信</string>
<string name="send_with_swap_notification_text">トークンを送信すれば、送信中に変換されます。受信者は必要なものをシームレスに受け取ります。</string>
<string name="send_with_swap_recipient_amount_success_title">受信者は受け取ります</string>
<string name="send_with_swap_recipient_amount_text">受信者に送信されます</string>
<string name="send_with_swap_recipient_amount_title">受取金額</string>
<string name="send_with_swap_remove_convert_alert_message">変換をキャンセルしてもよろしいですか? 変更後、以前のデータはリセットされます。</string>
<string name="send_with_swap_remove_convert_alert_title">キャンセルの確認</string>
<string name="send_with_swap_title">スワップして送信</string>
<string name="sent_transaction_sent_title">取引が送信されました</string>
<string name="settings_card_settings_footer">設定したいカードまたはリングをスキャンするために準備してください。</string>
@ -1428,6 +1440,8 @@
<string name="wc_transaction_request">取引リクエスト</string>
<string name="wc_transaction_request_title">取引リクエスト</string>
<string name="wc_unlimited_amount">無制限</string>
<string name="wc_uri_already_used_description">各ペアリング試行で、新しくユニークなURIが使用されていることを確認します</string>
<string name="wc_uri_already_used_title">URIはすでに使用されています</string>
<string name="wc_wallet_connect">ウォレットコネクト</string>
<string name="welcome_interrupted_backup_alert_discard">破棄</string>
<string name="welcome_interrupted_backup_alert_message">バックアップが中断されました。再開しますか?</string>

View file

@ -1105,6 +1105,8 @@
<string name="transaction_history_transaction_from_address">от: %s</string>
<string name="transaction_history_transaction_to_address">на: %s</string>
<string name="transaction_history_transaction_validator">валидатор: %s</string>
<string name="transaction_notifications_warning_description">Уведомления включены, но не будут работать, пока вы не разрешите их в настройках устройства.</string>
<string name="transaction_notifications_warning_title">Уведомления о транзакциях</string>
<string name="transfer_min_amount_error">Минимум %s</string>
<string name="transfer_notification_invalid_minimum_transaction_amount_text">Минимальная сумма транзакции равна %1$s.</string>
<string name="tron_will_be_send_token_fee_description">Комиссии сети Tron для популярных токенов могут быть выше. Стейкинг TRX может помочь снизить расходы на транзакции.</string>
@ -1182,6 +1184,7 @@
<string name="wallet_promo_banner_description">Получите доступ к более чем 13 000 криптовалют. Покупайте, продавайте, обменивайте и стейкайте в один клик. Свяжите до трех карт для резервного копирования. </string>
<string name="wallet_promo_banner_title">Откройте Tangem Wallet</string>
<string name="wallet_settings_push_notifications_description">Получайте уведомления о входящих транзакциях в кошельке и обновлениях Tangem.</string>
<string name="wallet_settings_push_notifications_huawei_warning">В настоящий момент push-уведомления могут не работать на устройствах Huawei. Мы уже работаем над решением этой проблемы и планируем исправление в ближайших обновлениях. Спасибо за понимание!</string>
<string name="wallet_settings_push_notifications_title">Уведомления о транзакциях</string>
<string name="wallet_settings_title">Настройки кошелька</string>
<string name="wallet_title">Tangem</string>

View file

@ -1105,6 +1105,8 @@
<string name="transaction_history_transaction_from_address">від: %s</string>
<string name="transaction_history_transaction_to_address">до: %s</string>
<string name="transaction_history_transaction_validator">валідатор: %s</string>
<string name="transaction_notifications_warning_description">Сповіщення ввімкнені, але не працюватимуть, доки ви не дозволите їх у налаштуваннях пристрою.</string>
<string name="transaction_notifications_warning_title">Сповіщення про транзакції</string>
<string name="transfer_min_amount_error">Мінімум %s</string>
<string name="transfer_notification_invalid_minimum_transaction_amount_text">Мінімальна сума транзакції становить %1$s.</string>
<string name="tron_will_be_send_token_fee_description">Комісії мережі Tron для популярних токенів можуть бути вищими. Стейкінг TRX може допомогти знизити транзакційні витрати.</string>

View file

@ -64,6 +64,10 @@
<string name="auth_info_add_wallet_title">Add Wallet</string>
<string name="auth_info_subtitle">Select a wallet to log in</string>
<string name="auth_info_title">Welcome back!</string>
<plurals name="auth_wallet_hardware_description">
<item quantity="one">%d card</item>
<item quantity="other">%d cards</item>
</plurals>
<string name="auth_wallet_mobile_description">Phone Wallet</string>
<string name="backup_complete_description">You successfully backed up your wallet.</string>
<string name="backup_complete_seed_description">These words cant be recovered if lost. Make sure to keep it somewhere secure.</string>
@ -426,6 +430,7 @@
<string name="hw_activation_need_description">To complete setup, back up your wallet and secure app access with a Access Code.</string>
<string name="hw_activation_need_finish">Finish Now</string>
<string name="hw_activation_need_title">Finish Wallet Activation</string>
<string name="hw_activation_need_warning_description">To complete setup, secure app access with Access Code.</string>
<string name="hw_backup_google_drive_description">Recover an existing wallet stored in your Google Drive backup</string>
<string name="hw_backup_google_drive_title">Google Drive Backup</string>
<string name="hw_backup_need_action">Go to backup</string>
@ -866,6 +871,7 @@
<string name="send_date_format">%1$s, %2$s</string>
<string name="send_destination_tag_field">Destination Tag</string>
<string name="send_enter_address_field">Enter address</string>
<string name="send_enter_address_field_ens">Enter ENS name or address</string>
<string name="send_error_address_same_as_wallet">Address is the same as wallet address</string>
<string name="send_error_dust_amount_format">Minimum amount is %s</string>
<string name="send_error_dust_change_format">Minimum change is %s</string>
@ -947,11 +953,15 @@
<string name="send_validation_invalid_amount">Invalid amount</string>
<string name="send_validation_invalid_fee">Fee exceeds balance</string>
<string name="send_validation_invalid_total">Total amount exceeds balance</string>
<string name="send_with_swap_change_token_alert_message">Are you sure you want to change the token? After changing, previous data will be reset.</string>
<string name="send_with_swap_change_token_alert_title">Changing token</string>
<string name="send_with_swap_confirm_title">Swap and send</string>
<string name="send_with_swap_notification_text">Send any token, and well convert it on the way. Your recipient gets exactly what they need—seamlessly.</string>
<string name="send_with_swap_recipient_amount_success_title">Recipient will receive</string>
<string name="send_with_swap_recipient_amount_text">Will be sent a recipient</string>
<string name="send_with_swap_recipient_amount_title">Amount to receive</string>
<string name="send_with_swap_remove_convert_alert_message">Are you sure you want to cancel the conversion? After changing, previous data will be reset.</string>
<string name="send_with_swap_remove_convert_alert_title">Confirm cancelation</string>
<string name="send_with_swap_title">Send with swap</string>
<string name="sent_transaction_sent_title">Transaction sent</string>
<string name="settings_card_settings_footer">Prepare to scan card or ring you want to set up.</string>
@ -1341,6 +1351,7 @@
<string name="wallet_settings_access_code_description">Secret code to protect this wallet. Used for login and signatures.</string>
<string name="wallet_settings_access_code_title">Set/Change Access Code</string>
<string name="wallet_settings_push_notifications_description">Stay notified on wallet incoming transactions and Tangem updates.</string>
<string name="wallet_settings_push_notifications_huawei_warning">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!</string>
<string name="wallet_settings_push_notifications_title">Transaction Notifications</string>
<string name="wallet_settings_title">Wallet settings</string>
<string name="wallet_title">Tangem</string>
@ -1497,6 +1508,8 @@
<string name="wc_transaction_request">Transaction request</string>
<string name="wc_transaction_request_title">Transaction request</string>
<string name="wc_unlimited_amount">Unlimited Amount</string>
<string name="wc_uri_already_used_description">Ensure that each pairing attempt uses a fresh and unique URI</string>
<string name="wc_uri_already_used_title">URI already used</string>
<string name="wc_wallet_connect">Wallet connect</string>
<string name="welcome_interrupted_backup_alert_discard">Discard</string>
<string name="welcome_interrupted_backup_alert_message">You have an interrupted backup. Do you want to resume?</string>

View file

@ -7,4 +7,5 @@ interface AppInfoProvider {
val language: String
val timezone: String
val appVersion: String
val isHuaweiDevice: Boolean
}

View file

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

View file

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