diff --git a/Example/TangemSdkExample/AppModel.swift b/Example/TangemSdkExample/AppModel.swift index 6f1c1e39..fa830061 100644 --- a/Example/TangemSdkExample/AppModel.swift +++ b/Example/TangemSdkExample/AppModel.swift @@ -72,6 +72,7 @@ class AppModel: ObservableObject { .ed25519_slip0010: [try! DerivationPath(rawPath: "m/0'/1'")], .bip0340: [try! DerivationPath(rawPath: "m/0'/1")] ] + _tangemSdk.config = config return _tangemSdk } diff --git a/Package.swift b/Package.swift index 0f31c037..f0e558b7 100644 --- a/Package.swift +++ b/Package.swift @@ -39,6 +39,7 @@ let package = Package( .copy("Haptics"), .copy("Crypto/BIP39/Wordlists/english.txt"), .copy("PrivacyInfo.xcprivacy"), + .copy("Assets"), ] ), .target( diff --git a/TangemSdk.podspec b/TangemSdk.podspec index 5ff759a5..4e1e693b 100644 --- a/TangemSdk.podspec +++ b/TangemSdk.podspec @@ -48,6 +48,7 @@ Tangem is a Swiss-based secure hardware wallet manufacturer that enables blockch 'TangemSdk/TangemSdk/Haptics/*.ahap', 'TangemSdk/TangemSdk/**/Wordlists/*.txt', 'TangemSdk/TangemSdk/PrivacyInfo.xcprivacy', + 'TangemSdk/TangemSdk/Assets/*.xcassets', ] } diff --git a/TangemSdk/TangemSdk.xcodeproj/project.pbxproj b/TangemSdk/TangemSdk.xcodeproj/project.pbxproj index 7a813a34..8927e911 100644 --- a/TangemSdk/TangemSdk.xcodeproj/project.pbxproj +++ b/TangemSdk/TangemSdk.xcodeproj/project.pbxproj @@ -290,6 +290,7 @@ DC7254902A03E20A0003FE1B /* DerivedKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC72548F2A03E20A0003FE1B /* DerivedKeys.swift */; }; DC8B0E3F286F221D009D64F7 /* BiometricsUtil.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC8B0E3E286F221D009D64F7 /* BiometricsUtil.swift */; }; DCA9706628E35EAD0046E62E /* GenerateOTPCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCA9706528E35EAD0046E62E /* GenerateOTPCommand.swift */; }; + DCACA0402CB51FF400A3DD51 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DCACA03F2CB51FF400A3DD51 /* Assets.xcassets */; }; DCB5A4E02A1F969F0021E12D /* HKDFUtil.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCB5A4DF2A1F969F0021E12D /* HKDFUtil.swift */; }; DCB5A4E32A1FAB330021E12D /* BLSUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCB5A4E22A1FAB330021E12D /* BLSUtils.swift */; }; DCB5A4E52A1FAC190021E12D /* BLSTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCB5A4E42A1FAC190021E12D /* BLSTests.swift */; }; @@ -680,6 +681,7 @@ DC72548F2A03E20A0003FE1B /* DerivedKeys.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DerivedKeys.swift; sourceTree = ""; }; DC8B0E3E286F221D009D64F7 /* BiometricsUtil.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BiometricsUtil.swift; sourceTree = ""; }; DCA9706528E35EAD0046E62E /* GenerateOTPCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GenerateOTPCommand.swift; sourceTree = ""; }; + DCACA03F2CB51FF400A3DD51 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; DCB5A4DF2A1F969F0021E12D /* HKDFUtil.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HKDFUtil.swift; sourceTree = ""; }; DCB5A4E22A1FAB330021E12D /* BLSUtils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BLSUtils.swift; sourceTree = ""; }; DCB5A4E42A1FAC190021E12D /* BLSTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BLSTests.swift; sourceTree = ""; }; @@ -1243,6 +1245,7 @@ 5DA80C9C231D247A00A50A10 /* TangemSdk */ = { isa = PBXGroup; children = ( + DCACA03E2CB51FDF00A3DD51 /* Assets */, 5DA80C9D231D247A00A50A10 /* TangemSdk.h */, 5D5369D124461F62002886E0 /* module.modulemap */, DC44C5892B4DC1B200888BED /* PrivacyInfo.xcprivacy */, @@ -1558,6 +1561,14 @@ path = PreflightReadFilter; sourceTree = ""; }; + DCACA03E2CB51FDF00A3DD51 /* Assets */ = { + isa = PBXGroup; + children = ( + DCACA03F2CB51FF400A3DD51 /* Assets.xcassets */, + ); + path = Assets; + sourceTree = ""; + }; DCB5A4E12A1FAB190021E12D /* BLS */ = { isa = PBXGroup; children = ( @@ -1872,6 +1883,7 @@ DC1244B529B60E480037BC05 /* english.txt in Resources */, 5DD5368C2476B3FB00F5DE88 /* Error.ahap in Resources */, 5D5369D224461F62002886E0 /* module.modulemap in Resources */, + DCACA0402CB51FF400A3DD51 /* Assets.xcassets in Resources */, 5D6A92D82344E2D700158457 /* Localizable.strings in Resources */, 5DD5368B2476B3FB00F5DE88 /* Success.ahap in Resources */, ); diff --git a/TangemSdk/TangemSdk/Assets/Assets.xcassets/Contents.json b/TangemSdk/TangemSdk/Assets/Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/TangemSdk/TangemSdk/Assets/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/TangemSdk/TangemSdk/Assets/Assets.xcassets/ring_shape_scan.imageset/Contents.json b/TangemSdk/TangemSdk/Assets/Assets.xcassets/ring_shape_scan.imageset/Contents.json new file mode 100644 index 00000000..0c9cd061 --- /dev/null +++ b/TangemSdk/TangemSdk/Assets/Assets.xcassets/ring_shape_scan.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "ring_shape_scan.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/TangemSdk/TangemSdk/Assets/Assets.xcassets/ring_shape_scan.imageset/ring_shape_scan.pdf b/TangemSdk/TangemSdk/Assets/Assets.xcassets/ring_shape_scan.imageset/ring_shape_scan.pdf new file mode 100644 index 00000000..191437af Binary files /dev/null and b/TangemSdk/TangemSdk/Assets/Assets.xcassets/ring_shape_scan.imageset/ring_shape_scan.pdf differ diff --git a/TangemSdk/TangemSdk/Common/Core/CardSession.swift b/TangemSdk/TangemSdk/Common/Core/CardSession.swift index d19d0032..c2734f21 100644 --- a/TangemSdk/TangemSdk/Common/Core/CardSession.swift +++ b/TangemSdk/TangemSdk/Common/Core/CardSession.swift @@ -49,6 +49,10 @@ public class CardSession { private var accessCodeRepository: AccessCodeRepository? = nil private let filter: SessionFilter? + private var defaultScanMessage: String { + "view_delegate_scan_description_format".localized(environment.config.productType.localizedDescription) + } + private var shouldRequestBiometrics: Bool { guard let accessCodeRepository = self.accessCodeRepository else { return false @@ -190,7 +194,7 @@ public class CardSession { self.viewDelegate.tagConnected() self.viewDelegate.setState(.default) case .tagLost: - self.viewDelegate.tagLost() + self.viewDelegate.tagLost(message: defaultScanMessage) self.viewDelegate.setState(.scan) } }) @@ -226,7 +230,7 @@ public class CardSession { }) .store(in: &nfcReaderSubscriptions) - reader.startSession(with: initialMessage?.alertMessage) + reader.startSession(with: initialMessage?.alertMessage ?? defaultScanMessage) } // MARK: - Session stop and pause @@ -510,7 +514,7 @@ public class CardSession { func continueRunnable(code: String) { self.updateEnvironment(with: type, code: code) self.viewDelegate.setState(.default) - self.viewDelegate.showAlertMessage("view_delegate_scan_description".localized) + self.viewDelegate.showAlertMessage(defaultScanMessage) completion(.success(())) } diff --git a/TangemSdk/TangemSdk/Common/Core/Config.swift b/TangemSdk/TangemSdk/Common/Core/Config.swift index b255a686..3d56b86b 100644 --- a/TangemSdk/TangemSdk/Common/Core/Config.swift +++ b/TangemSdk/TangemSdk/Common/Core/Config.swift @@ -39,7 +39,10 @@ public struct Config { /// Card id display format. Full card id will be displayed by default public var cardIdDisplayFormat: CardIdDisplayFormat = .full - + + /// Product to work with. Affect animations and texts. + public var productType: ProductType = .any + /// Logger configuration public var logConfig: Log.Config = .default @@ -66,6 +69,23 @@ public struct Config { /// Localized reason for Touch ID. DO NOT leave it empty. public var biometricsLocalizedReason: String = "touch_id_localized_reason".localized + + public mutating func setupForProduct(_ product: ProductType) { + switch product { + case .card: + productType = .card + cardIdDisplayFormat = .full + style.scanTagImage = .genericCard + case .ring: + productType = .ring + cardIdDisplayFormat = .none + style.scanTagImage = .genericRing + case .any: + productType = .any + cardIdDisplayFormat = .full + style.scanTagImage = .genericCard + } + } } public enum CardIdDisplayFormat { @@ -89,3 +109,21 @@ public enum AccessCodeRequestPolicy: String, CaseIterable { /// User code will be requested only if set on the card. Need scan the card twice. case `default` } + +public enum ProductType { + case any + case card + case ring + + @available(iOS 13.0, *) + var localizedDescription: String { + switch self { + case .card: + "common_card".localized + case .ring: + "common_ring".localized + case .any: + "common_card_or_ring".localized + } + } +} diff --git a/TangemSdk/TangemSdk/Common/Localization/Resources/de.lproj/Localizable.strings b/TangemSdk/TangemSdk/Common/Localization/Resources/de.lproj/Localizable.strings index ca8e3659..779dfddc 100644 --- a/TangemSdk/TangemSdk/Common/Localization/Resources/de.lproj/Localizable.strings +++ b/TangemSdk/TangemSdk/Common/Localization/Resources/de.lproj/Localizable.strings @@ -3,17 +3,22 @@ "attestation_online_failed_body" = "Der Online-Nachweis/ Prüfung der Karte kann derzeit nicht durchgeführt werden. Du kannst auf eigenem Risiko fortfahren oder es später erneut versuchen."; "attestation_online_failed_title" = "Online-Nachweis/Prüfung fehlgeschlagen"; "attestation_warning_attest_wallets" = "Eine verdächtige Verwendung der Wallet auf der Karte wurde festgestellt."; -"backup_add_backup_card_message" = "Verbinde dein Telefon und die Karte, die du als Backup verwenden möchten, genau wie oben gezeigt."; +"backup_add_backup_card_message" = "Verbinde dein Telefon und die Karte oder den Ring, die du als Backup verwenden möchten, genau wie oben gezeigt."; "backup_finalize_backup_card_message_format" = "Halte die Karte mit der Nummer %@ genau wie oben gezeigt, auf deinem Telefon."; +"backup_finalize_backup_ring_message" = "Tippe mit dem Ring genau wie oben gezeigt auf Dein Smartphone."; "backup_finalize_primary_card_message_format" = "Verbinde dein Telefon und die vorherige Karte mit der Nummer %@ genau wie oben gezeigt."; +"backup_finalize_primary_ring_message" = "Verbinde Dein Telefon und den primären Ring wie oben gezeigt."; "backup_prepare_primary_card_message" = "Verbinde dein Telefon und die primäre Karte genau wie oben gezeigt."; "backup_prepare_primary_card_message_format" = "Verbinde dein Telefon und die primäre Karte mit der Nummer %@ genau wie oben gezeigt."; "cid_format" = "Karte Nr.%@"; "common_cancel" = "Abbrechen"; +"common_card" = "card"; +"common_card_or_ring" = "card or ring"; "common_continue" = "Fortsetzen"; "common_error" = "Fehler"; "common_ok" = "OK"; "common_retry" = "Wiederholen"; +"common_ring" = "ring"; "common_success" = "Erfolg"; "common_understand" = "Ich verstehe"; "common_warning" = "Warnung"; @@ -55,16 +60,18 @@ "reset_codes_current_card" = "Aktuelle Karte"; "reset_codes_linked_card" = "Verknüpfte Karte"; "reset_codes_message_body_backup" = "Halte die verknüpfte Karte dran"; -"reset_codes_message_body_restore" = "Bereite zunächst die Karte für den Wiederherstellungsprozess vor"; +"reset_codes_message_body_restore" = "Bereite zunächst die Karte oder den Ring für den Wiederherstellungsprozess vor"; "reset_codes_message_body_restore_final" = "Halte die Karte erneut dran, auf der du den Zugangscode wiederherstellen möchtest"; -"reset_codes_message_title_backup" = "Halte eine Backup-Karte dran"; -"reset_codes_message_title_restore" = "Halte die Karte dran, die du wiederherstellen möchtest"; -"reset_codes_scan_confirmation_card" = "Eine andere verknüpfte Karte scannen"; +"reset_codes_message_title_backup" = "Halte eine Backup-Karte oder Ring dran"; +"reset_codes_message_title_restore" = "Halte die Karte oder den Ring dran, die du wiederherstellen möchtest"; +"reset_codes_scan_confirmation_card" = "Eine andere verknüpfte Karte oder Ring scannen"; "reset_codes_scan_first_card" = "Scanne die Karte, auf der du %@ zurücksetzen möchtest"; -"reset_codes_scan_to_reset" = "Scanne die Karte, um Benutzercodes zurückzusetzen"; +"reset_codes_scan_to_reset" = "Scanne die Karte oder den Ring, um Benutzercodes zurückzusetzen"; "reset_codes_success_message" = "Code wurde erfolgreich zurückgesetzt"; "sign_multiple_chunks_part" = "Unterzeichnung von Teil %1$li von %2$li"; "touch_id_localized_reason" = "Verwende Touch ID, um Zugangscodes in der App zu speichern"; -"view_delegate_scan_description" = "Halte die Karte bis zum Ende des Vorgangs gedrückt, wie oben gezeigt"; -"view_delegate_security_delay_description" = "Um die Sicherheit zu gewährleisten, halte die Karte bitte bis zum Abschluss des Vorgangs angedrückt."; +"view_delegate_scan_description" = "Halte die Karte oder den Ring bis zum Ende des Vorgangs gedrückt, wie oben gezeigt"; +"view_delegate_scan_description_format" = "Tap the %@ as shown above and hold until the end of the operation"; +"view_delegate_security_delay_description" = "Um die Sicherheit zu gewährleisten, halte die Karte oder den Ring bitte bis zum Abschluss des Vorgangs angedrückt."; +"view_delegate_security_delay_description_format" = "To ensure security please hold the %@ until the operation is complete"; "wallet_not_found" = "Sieht so aus, als hättest du die falsche Karte. Der Vorgang kann mit dieser Karte nicht durchgeführt werden."; diff --git a/TangemSdk/TangemSdk/Common/Localization/Resources/en.lproj/Localizable.strings b/TangemSdk/TangemSdk/Common/Localization/Resources/en.lproj/Localizable.strings index 0b1c9e7a..33aafaa2 100644 --- a/TangemSdk/TangemSdk/Common/Localization/Resources/en.lproj/Localizable.strings +++ b/TangemSdk/TangemSdk/Common/Localization/Resources/en.lproj/Localizable.strings @@ -3,17 +3,22 @@ "attestation_online_failed_body" = "At the moment, online attestation of the card cannot be performed. You can continue at your own risk or try again later."; "attestation_online_failed_title" = "Online attestation failed"; "attestation_warning_attest_wallets" = "Suspicious use of the wallet on the card has been detected."; -"backup_add_backup_card_message" = "Connect your phone and the card you want to use as a backup exactly as it shown above."; +"backup_add_backup_card_message" = "Connect your phone to the card or ring you want to use as a backup, exactly as shown above."; "backup_finalize_backup_card_message_format" = "Tap the card with number %@ to your phone exactly as shown above."; +"backup_finalize_backup_ring_message" = "Tap the ring to your phone exactly as shown above."; "backup_finalize_primary_card_message_format" = "Connect your phone and the primary card with number %@ exactly as it shown above."; +"backup_finalize_primary_ring_message" = "Connect your phone and the primary ring as it shown above."; "backup_prepare_primary_card_message" = "Connect your phone and the primary card exactly as it shown above."; "backup_prepare_primary_card_message_format" = "Connect your phone and the primary card with number %@ exactly as it shown above."; "cid_format" = "Card #%@"; "common_cancel" = "Cancel"; +"common_card" = "card"; +"common_card_or_ring" = "card or ring"; "common_continue" = "Continue"; "common_error" = "Error"; "common_ok" = "OK"; "common_retry" = "Retry"; +"common_ring" = "ring"; "common_success" = "Success"; "common_understand" = "I understand"; "common_warning" = "Warning"; @@ -55,16 +60,18 @@ "reset_codes_current_card" = "Current card"; "reset_codes_linked_card" = "Linked card"; "reset_codes_message_body_backup" = "Tap the linked card"; -"reset_codes_message_body_restore" = "First, prepare the card for restore process"; +"reset_codes_message_body_restore" = "First, prepare the card or ring for restore process"; "reset_codes_message_body_restore_final" = "Tap again the card on which you want to restore the access code"; -"reset_codes_message_title_backup" = "Tap a backup card"; -"reset_codes_message_title_restore" = "Tap the card you want to restore"; -"reset_codes_scan_confirmation_card" = "Scan another linked card"; +"reset_codes_message_title_backup" = "Tap a backup card or ring"; +"reset_codes_message_title_restore" = "Tap the card or ring you want to restore"; +"reset_codes_scan_confirmation_card" = "Scan another linked card or ring"; "reset_codes_scan_first_card" = "Scan the card on which you want to reset the %@"; -"reset_codes_scan_to_reset" = "Scan card to reset user codes"; +"reset_codes_scan_to_reset" = "Scan card or ring to reset user codes"; "reset_codes_success_message" = "Code was reset successfully"; "sign_multiple_chunks_part" = "Signing part %1$li of %2$li"; "touch_id_localized_reason" = "Use Touch ID to save access codes in the app"; -"view_delegate_scan_description" = "Tap the card as shown above and hold until the end of the operation"; -"view_delegate_security_delay_description" = "To ensure security please hold the card until the operation complete"; +"view_delegate_scan_description" = "Tap the card or ring as shown above and hold until the end of the operation"; +"view_delegate_scan_description_format" = "Tap the %@ as shown above and hold until the end of the operation"; +"view_delegate_security_delay_description" = "To ensure security please hold the card or ring until the operation complete"; +"view_delegate_security_delay_description_format" = "To ensure security please hold the %@ until the operation is complete"; "wallet_not_found" = "Looks like you got the wrong card. The operation cannot be performed with this card."; diff --git a/TangemSdk/TangemSdk/Common/Localization/Resources/es.lproj/Localizable.strings b/TangemSdk/TangemSdk/Common/Localization/Resources/es.lproj/Localizable.strings index 060af5de..c2ae53ec 100644 --- a/TangemSdk/TangemSdk/Common/Localization/Resources/es.lproj/Localizable.strings +++ b/TangemSdk/TangemSdk/Common/Localization/Resources/es.lproj/Localizable.strings @@ -5,15 +5,20 @@ "attestation_warning_attest_wallets" = "Se ha detectado un uso sospechoso del monedero de la tarjeta."; "backup_add_backup_card_message" = "Conecte su teléfono y la tarjeta que desea usar como respaldo exactamente como se muestra arriba."; "backup_finalize_backup_card_message_format" = "Toque la tarjeta con el número %@ en su teléfono exactamente como se muestra arriba."; +"backup_finalize_backup_ring_message" = "Tap the ring to your phone exactly as shown above."; "backup_finalize_primary_card_message_format" = "Conecte su teléfono y la placa principal con el número %@ exactamente como se muestra arriba."; +"backup_finalize_primary_ring_message" = "Connect your phone and the primary ring as it shown above."; "backup_prepare_primary_card_message" = "Conecte su teléfono y la placa principal exactamente como se muestra arriba."; "backup_prepare_primary_card_message_format" = "Conecte su teléfono y la placa principal con el número %@ exactamente como se muestra arriba."; "cid_format" = "Tarjeta no. %@"; "common_cancel" = "Cancelar"; +"common_card" = "card"; +"common_card_or_ring" = "card or ring"; "common_continue" = "Continuar"; "common_error" = "Error"; "common_ok" = "OK"; "common_retry" = "Inténtalo de nuevo"; +"common_ring" = "ring"; "common_success" = "Con éxito"; "common_understand" = "Entiendo"; "common_warning" = "Cuidado"; @@ -66,5 +71,7 @@ "sign_multiple_chunks_part" = "Parte de firma %1$li de %2$li"; "touch_id_localized_reason" = "Use Touch ID para guardar códigos de acceso en la aplicación"; "view_delegate_scan_description" = "Presione la tarjeta como se muestra arriba y manténgala presionada hasta que se complete la operación."; +"view_delegate_scan_description_format" = "Tap the %@ as shown above and hold until the end of the operation"; "view_delegate_security_delay_description" = "Para garantizar la seguridad, conserve la tarjeta hasta que se complete la transacción."; +"view_delegate_security_delay_description_format" = "To ensure security please hold the %@ until the operation is complete"; "wallet_not_found" = "Parece que se equivocó de mapa. La operación no se puede realizar con esta tarjeta."; diff --git a/TangemSdk/TangemSdk/Common/Localization/Resources/fr.lproj/Localizable.strings b/TangemSdk/TangemSdk/Common/Localization/Resources/fr.lproj/Localizable.strings index 96dba792..c32764cd 100644 --- a/TangemSdk/TangemSdk/Common/Localization/Resources/fr.lproj/Localizable.strings +++ b/TangemSdk/TangemSdk/Common/Localization/Resources/fr.lproj/Localizable.strings @@ -5,15 +5,20 @@ "attestation_warning_attest_wallets" = "Une utilisation suspecte du portefeuille sur la carte a été détectée."; "backup_add_backup_card_message" = "Connectez votre téléphone et la carte que vous souhaitez utiliser comme sauvegarde exactement comme indiqué ci-dessus."; "backup_finalize_backup_card_message_format" = "Appuyez la carte portant le numéro %@ sur votre téléphone exactement comme indiqué ci-dessus."; +"backup_finalize_backup_ring_message" = "Tap the ring to your phone exactly as shown above."; "backup_finalize_primary_card_message_format" = "Connectez votre téléphone et la carte principale avec le numéro %@ exactement comme indiqué ci-dessus."; +"backup_finalize_primary_ring_message" = "Connect your phone and the primary ring as it shown above."; "backup_prepare_primary_card_message" = "Connectez votre téléphone et la carte principale exactement comme indiqué ci-dessus."; "backup_prepare_primary_card_message_format" = "Connectez votre téléphone et la carte principale avec le numéro %@ exactement comme indiqué ci-dessus."; "cid_format" = "Carte n°%@"; "common_cancel" = "Annuler"; +"common_card" = "card"; +"common_card_or_ring" = "card or ring"; "common_continue" = "Continuer"; "common_error" = "Erreur"; "common_ok" = "OK"; "common_retry" = "Réessayez"; +"common_ring" = "ring"; "common_success" = "Avec succès"; "common_understand" = "Je comprends"; "common_warning" = "Attention"; @@ -66,5 +71,7 @@ "sign_multiple_chunks_part" = "Signature de la partie %1$li de %2$li"; "touch_id_localized_reason" = "Utilisez Touch ID pour enregistrer les codes d'accès dans l'application"; "view_delegate_scan_description" = "Appuyez sur la carte comme indiqué ci-dessus et maintenez jusqu'à la fin de l'opération"; +"view_delegate_scan_description_format" = "Tap the %@ as shown above and hold until the end of the operation"; "view_delegate_security_delay_description" = "Pour garantir la sécurité, veuillez conserver la carte jusqu'à ce que l'opération soit terminée."; +"view_delegate_security_delay_description_format" = "To ensure security please hold the %@ until the operation is complete"; "wallet_not_found" = "On dirait que vous vous êtes trompé de carte. L'opération ne peut pas être effectuée avec cette carte."; diff --git a/TangemSdk/TangemSdk/Common/Localization/Resources/it.lproj/Localizable.strings b/TangemSdk/TangemSdk/Common/Localization/Resources/it.lproj/Localizable.strings index 29e63376..28dfc12a 100644 --- a/TangemSdk/TangemSdk/Common/Localization/Resources/it.lproj/Localizable.strings +++ b/TangemSdk/TangemSdk/Common/Localization/Resources/it.lproj/Localizable.strings @@ -3,17 +3,22 @@ "attestation_online_failed_body" = "At the moment, online attestation of the card cannot be performed. You can continue at your own risk or try again later."; "attestation_online_failed_title" = "Online attestation failed"; "attestation_warning_attest_wallets" = "Suspicious use of the wallet on the card has been detected."; -"backup_add_backup_card_message" = "Connect your phone and the card you want to use as a backup exactly as it shown above."; +"backup_add_backup_card_message" = "Connect your phone to the card or ring you want to use as a backup, exactly as shown above."; "backup_finalize_backup_card_message_format" = "Tap the card with number %@ to your phone exactly as shown above."; +"backup_finalize_backup_ring_message" = "Tap the ring to your phone exactly as shown above."; "backup_finalize_primary_card_message_format" = "Connect your phone and the primary card with number %@ exactly as it shown above."; +"backup_finalize_primary_ring_message" = "Connect your phone and the primary ring as it shown above."; "backup_prepare_primary_card_message" = "Connect your phone and the primary card exactly as it shown above."; "backup_prepare_primary_card_message_format" = "Connect your phone and the primary card with number %@ exactly as it shown above."; "cid_format" = "Card #%@"; "common_cancel" = "Annulla"; +"common_card" = "card"; +"common_card_or_ring" = "card or ring"; "common_continue" = "Continua"; "common_error" = "Errore"; "common_ok" = "OK"; "common_retry" = "Retry"; +"common_ring" = "ring"; "common_success" = "Con successo"; "common_understand" = "I understand"; "common_warning" = "Warning"; @@ -55,16 +60,18 @@ "reset_codes_current_card" = "Current card"; "reset_codes_linked_card" = "Linked card"; "reset_codes_message_body_backup" = "Tap the linked card"; -"reset_codes_message_body_restore" = "First, prepare the card for restore process"; +"reset_codes_message_body_restore" = "First, prepare the card or ring for restore process"; "reset_codes_message_body_restore_final" = "Tap again the card on which you want to restore the access code"; -"reset_codes_message_title_backup" = "Tap a backup card"; -"reset_codes_message_title_restore" = "Tap the card you want to restore"; -"reset_codes_scan_confirmation_card" = "Scan another linked card"; +"reset_codes_message_title_backup" = "Tap a backup card or ring"; +"reset_codes_message_title_restore" = "Tap the card or ring you want to restore"; +"reset_codes_scan_confirmation_card" = "Scan another linked card or ring"; "reset_codes_scan_first_card" = "Scan the card on which you want to reset the %@"; -"reset_codes_scan_to_reset" = "Scan card to reset user codes"; +"reset_codes_scan_to_reset" = "Scan card or ring to reset user codes"; "reset_codes_success_message" = "Code was reset successfully"; "sign_multiple_chunks_part" = "Signing part %1$li of %2$li"; "touch_id_localized_reason" = "Use Touch ID to save access codes in the app"; -"view_delegate_scan_description" = "Tap the card as shown above and hold until the end of the operation"; -"view_delegate_security_delay_description" = "To ensure security please hold the card until the operation complete"; +"view_delegate_scan_description" = "Tap the card or ring as shown above and hold until the end of the operation"; +"view_delegate_scan_description_format" = "Tap the %@ as shown above and hold until the end of the operation"; +"view_delegate_security_delay_description" = "To ensure security please hold the card or ring until the operation complete"; +"view_delegate_security_delay_description_format" = "To ensure security please hold the %@ until the operation is complete"; "wallet_not_found" = "Looks like you got the wrong card. The operation cannot be performed with this card."; diff --git a/TangemSdk/TangemSdk/Common/Localization/Resources/ja.lproj/Localizable.strings b/TangemSdk/TangemSdk/Common/Localization/Resources/ja.lproj/Localizable.strings index 400553e1..fd618abb 100644 --- a/TangemSdk/TangemSdk/Common/Localization/Resources/ja.lproj/Localizable.strings +++ b/TangemSdk/TangemSdk/Common/Localization/Resources/ja.lproj/Localizable.strings @@ -5,15 +5,20 @@ "attestation_warning_attest_wallets" = "カードのウォレットの不審な使用が検出されました。"; "backup_add_backup_card_message" = "スマートフォンとバックアップとして使用したいカードを、上記のとおりに接続してください。"; "backup_finalize_backup_card_message_format" = "上図のように、番号%@のカードをスマートフォンにタップしてください。"; +"backup_finalize_backup_ring_message" = "Tap the ring to your phone exactly as shown above."; "backup_finalize_primary_card_message_format" = "お使いのスマートフォンと番号%@のプライマリカードを、上記のように接続してください。"; +"backup_finalize_primary_ring_message" = "Connect your phone and the primary ring as it shown above."; "backup_prepare_primary_card_message" = "スマートフォンとプライマリカードを上記のとおりに接続してください。"; "backup_prepare_primary_card_message_format" = "お使いのスマートフォンと番号%@のプライマリカードを、上記のように接続してください。"; "cid_format" = "カード番号%@"; "common_cancel" = "キャンセル"; +"common_card" = "card"; +"common_card_or_ring" = "card or ring"; "common_continue" = "続ける"; "common_error" = "エラー"; "common_ok" = "わかりました"; "common_retry" = "再試行"; +"common_ring" = "ring"; "common_success" = "成功"; "common_understand" = "わかりました"; "common_warning" = "警告"; @@ -66,5 +71,7 @@ "sign_multiple_chunks_part" = "%2$liのうち%1$li部分に署名しています"; "touch_id_localized_reason" = "Touch IDを使用して、アプリにアクセスコードを保存します"; "view_delegate_scan_description" = "上記のようにカードをタップし、操作が完了するまでホールドし続けます。"; +"view_delegate_scan_description_format" = "Tap the %@ as shown above and hold until the end of the operation"; "view_delegate_security_delay_description" = "セキュリティを確保するため、操作が完了するまでカードをホールドしてください。"; +"view_delegate_security_delay_description_format" = "To ensure security please hold the %@ until the operation is complete"; "wallet_not_found" = "カードが間違っているようです。このカードでは操作を実行できません。"; diff --git a/TangemSdk/TangemSdk/Common/Localization/Resources/ru.lproj/Localizable.strings b/TangemSdk/TangemSdk/Common/Localization/Resources/ru.lproj/Localizable.strings index f03a2320..758110cd 100644 --- a/TangemSdk/TangemSdk/Common/Localization/Resources/ru.lproj/Localizable.strings +++ b/TangemSdk/TangemSdk/Common/Localization/Resources/ru.lproj/Localizable.strings @@ -3,17 +3,22 @@ "attestation_online_failed_body" = "В настоящее время онлайн аттестация карты не может быть выполнена. Вы можете продолжить на свой страх и риск или повторить попытку."; "attestation_online_failed_title" = "Онлайн-аттестация не удалась"; "attestation_warning_attest_wallets" = "Обнаружено подозрительное использование кошелька на карте."; -"backup_add_backup_card_message" = "Соедините телефон и карту, которую вы хотите использовать в качестве резервной, в точности, как показано выше."; +"backup_add_backup_card_message" = "Соедините телефон с картой или кольцом, которые вы хотите использовать в качестве резервных, точно так, как показано выше."; "backup_finalize_backup_card_message_format" = "Поднесите карту с номером %@ к телефону в точности, как показано выше."; +"backup_finalize_backup_ring_message" = "Поднесите кольцо к телефону в точности, как показано выше."; "backup_finalize_primary_card_message_format" = "Соедините телефон и основную карту с номером %@ в точности, как показано выше."; +"backup_finalize_primary_ring_message" = "Соедините телефон и основное кольцо в точности, как показано выше."; "backup_prepare_primary_card_message" = "Соедините телефон и основную карту в точности, как показано выше."; "backup_prepare_primary_card_message_format" = "Соедините телефон и основную карту с номером %@ в точности, как показано выше."; "cid_format" = "Карта #%@"; "common_cancel" = "Отменить"; +"common_card" = "карту"; +"common_card_or_ring" = "кольцо или карту"; "common_continue" = "Продолжить"; "common_error" = "Ошибка"; "common_ok" = "OK"; "common_retry" = "Повторить"; +"common_ring" = "кольцо"; "common_success" = "Успешно"; "common_understand" = "Я понимаю"; "common_warning" = "Предупреждение"; @@ -55,16 +60,18 @@ "reset_codes_current_card" = "Текущая карта"; "reset_codes_linked_card" = "Связанная карта"; "reset_codes_message_body_backup" = "Приложите связанную карту"; -"reset_codes_message_body_restore" = "Сначала подготовьте карту к процессу восстановления"; +"reset_codes_message_body_restore" = "Сначала подготовьте карту или кольцо к процессу восстановления"; "reset_codes_message_body_restore_final" = "Приложите еще раз карту, на которой хотите восстановить код доступа"; -"reset_codes_message_title_backup" = "Приложите резервную карту"; -"reset_codes_message_title_restore" = "Отсканируйте карту, которую хотите восстановить"; -"reset_codes_scan_confirmation_card" = "Отсканируйте другую привязанную карту"; +"reset_codes_message_title_backup" = "Приложите резервную карту или кольцо"; +"reset_codes_message_title_restore" = "Отсканируйте карту или кольцо, которую хотите восстановить"; +"reset_codes_scan_confirmation_card" = "Отсканируйте другую привязанную карту или кольцо"; "reset_codes_scan_first_card" = "Отсканируйте карту, на которой вы хотите сбросить %@"; -"reset_codes_scan_to_reset" = "Отсканируйте карту для сброса кода"; +"reset_codes_scan_to_reset" = "Отсканируйте карту или кольцо для сброса кода"; "reset_codes_success_message" = "Код успешно сброшен"; "sign_multiple_chunks_part" = "Подпись части %1$li из %2$li"; "touch_id_localized_reason" = "Используйте Touch ID для сохранения кодов доступа в приложении"; -"view_delegate_scan_description" = "Поднесите карту, как показано выше, и удерживайте до конца операции"; -"view_delegate_security_delay_description" = "Пожалуйста, удерживайте карту до завершения операции"; +"view_delegate_scan_description" = "Поднесите карту или кольцо, как показано выше, и удерживайте до конца операции"; +"view_delegate_scan_description_format" = "Поднесите %@, как показано выше, и удерживайте до конца операции"; +"view_delegate_security_delay_description" = "Пожалуйста, удерживайте карту или кольцо до завершения операции"; +"view_delegate_security_delay_description_format" = "Пожалуйста, удерживайте %@ до завершения операции"; "wallet_not_found" = "Кажется, вы ошиблись картой. Операция не может быть выполнена с этой картой."; diff --git a/TangemSdk/TangemSdk/Common/Localization/Resources/uk-UA.lproj/Localizable.strings b/TangemSdk/TangemSdk/Common/Localization/Resources/uk-UA.lproj/Localizable.strings index d49161af..7a07e648 100644 --- a/TangemSdk/TangemSdk/Common/Localization/Resources/uk-UA.lproj/Localizable.strings +++ b/TangemSdk/TangemSdk/Common/Localization/Resources/uk-UA.lproj/Localizable.strings @@ -5,15 +5,20 @@ "attestation_warning_attest_wallets" = "Виявлено підозріле використання гаманця на картці."; "backup_add_backup_card_message" = "З'єднайте телефон і картку, яку ви хочете використати як резервну, точно так, як показано вище."; "backup_finalize_backup_card_message_format" = "Піднесіть картку з номером %@ до телефону точно так, як показано вище."; +"backup_finalize_backup_ring_message" = "Tap the ring to your phone exactly as shown above."; "backup_finalize_primary_card_message_format" = "З'єднайте телефон і основну картку з номером %@ точно так, як показано вище."; +"backup_finalize_primary_ring_message" = "Connect your phone and the primary ring as it shown above."; "backup_prepare_primary_card_message" = "З'єднайте телефон і основну картку точно так, як показано вище."; "backup_prepare_primary_card_message_format" = "З'єднайте телефон і основну картку з номером %@ точно так, як показано вище."; "cid_format" = "Картка #%@"; "common_cancel" = "Скасувати"; +"common_card" = "card"; +"common_card_or_ring" = "card or ring"; "common_continue" = "Продовжити"; "common_error" = "Помилка"; "common_ok" = "OK"; "common_retry" = "Повторити"; +"common_ring" = "ring"; "common_success" = "Успішно"; "common_understand" = "Я розумію"; "common_warning" = "Попередження"; @@ -66,5 +71,7 @@ "sign_multiple_chunks_part" = "Підпис частини %1$li з %2$li"; "touch_id_localized_reason" = "Використовуйте Touch ID для збереження кодів доступу в додатку"; "view_delegate_scan_description" = "Піднесіть картку, як показано вище, і утримуйте до кінця операції"; +"view_delegate_scan_description_format" = "Tap the %@ as shown above and hold until the end of the operation"; "view_delegate_security_delay_description" = "Будь ласка, утримуйте картку до завершення операції"; +"view_delegate_security_delay_description_format" = "To ensure security please hold the %@ until the operation is complete"; "wallet_not_found" = "Здається, ви помилилися карткою. Операція не може бути виконана з цією карткою."; diff --git a/TangemSdk/TangemSdk/Common/Localization/Resources/zh-Hant.lproj/Localizable.strings b/TangemSdk/TangemSdk/Common/Localization/Resources/zh-Hant.lproj/Localizable.strings index a5d0b351..57d92594 100644 --- a/TangemSdk/TangemSdk/Common/Localization/Resources/zh-Hant.lproj/Localizable.strings +++ b/TangemSdk/TangemSdk/Common/Localization/Resources/zh-Hant.lproj/Localizable.strings @@ -5,15 +5,20 @@ "attestation_warning_attest_wallets" = "Suspicious use of the wallet on the card has been detected."; "backup_add_backup_card_message" = "完全按照上圖所示連接手機和要用作備份的卡"; "backup_finalize_backup_card_message_format" = "Tap the card with number %@ to your phone exactly as shown above."; +"backup_finalize_backup_ring_message" = "Tap the ring to your phone exactly as shown above."; "backup_finalize_primary_card_message_format" = "完全按照上面顯示的方式連接您的手機和編號為 %@ 的主卡"; +"backup_finalize_primary_ring_message" = "Connect your phone and the primary ring as it shown above."; "backup_prepare_primary_card_message" = "完全按照上圖所示連接手機和主卡"; "backup_prepare_primary_card_message_format" = "完全按照上面顯示的方式連接您的手機和編號為 %@ 的主卡"; "cid_format" = "卡片 #%@"; "common_cancel" = "取消"; +"common_card" = "card"; +"common_card_or_ring" = "card or ring"; "common_continue" = "繼續"; "common_error" = "錯誤"; "common_ok" = "OK"; "common_retry" = "重試"; +"common_ring" = "ring"; "common_success" = "成功"; "common_understand" = "我明白"; "common_warning" = "警告"; @@ -66,5 +71,7 @@ "sign_multiple_chunks_part" = "簽署第 %1$li 部分,共 %2$li"; "touch_id_localized_reason" = "使用 Touch ID 在應用程序中保存訪問密碼"; "view_delegate_scan_description" = "如上圖觸碰卡片並按住直到操作結束"; +"view_delegate_scan_description_format" = "Tap the %@ as shown above and hold until the end of the operation"; "view_delegate_security_delay_description" = "為確保安全,請持有卡直至操作完成"; +"view_delegate_security_delay_description_format" = "To ensure security please hold the %@ until the operation is complete"; "wallet_not_found" = "Looks like you got the wrong card. The operation cannot be performed with this card."; diff --git a/TangemSdk/TangemSdk/Common/NFC/CardReader.swift b/TangemSdk/TangemSdk/Common/NFC/CardReader.swift index 41ac911f..4ee0dbc2 100644 --- a/TangemSdk/TangemSdk/Common/NFC/CardReader.swift +++ b/TangemSdk/TangemSdk/Common/NFC/CardReader.swift @@ -35,7 +35,7 @@ public protocol CardReader: AnyObject { var alertMessage: String { get set } var tag: CurrentValueSubject { get } var viewEventsPublisher: CurrentValueSubject { get } - func startSession(with message: String?) + func startSession(with message: String) func resumeSession() func stopSession(with errorMessage: String?) func pauseSession(with errorMessage: String?) @@ -45,10 +45,6 @@ public protocol CardReader: AnyObject { } public extension CardReader { - func startSession(with message: String? = nil) { - startSession(with: message) - } - func pauseSession(with errorMessage: String? = nil) { pauseSession(with: errorMessage) } diff --git a/TangemSdk/TangemSdk/Common/NFC/NFCReader.swift b/TangemSdk/TangemSdk/Common/NFC/NFCReader.swift index 8840b32d..10ef1e6c 100644 --- a/TangemSdk/TangemSdk/Common/NFC/NFCReader.swift +++ b/TangemSdk/TangemSdk/Common/NFC/NFCReader.swift @@ -119,7 +119,7 @@ extension NFCReader: CardReader { } /// Start session and try to connect with tag - func startSession(with message: String?) { + func startSession(with message: String) { Log.nfc("Start NFC session") bag = Set() isPaused = false @@ -133,8 +133,7 @@ extension NFCReader: CardReader { firstConnectionTS = nil sessionDidBecomeActiveTS = Date() - let alertMessage = message ?? "view_delegate_scan_description".localized - _alertMessage = alertMessage + _alertMessage = message let isExistingSessionActive = readerSession?.isReady ?? false if !isExistingSessionActive { @@ -248,7 +247,7 @@ extension NFCReader: CardReader { func resumeSession() { Log.nfc("Resume reader session invoked") isPaused = false - startSession(with: _alertMessage) + startSession(with: _alertMessage ?? "") } func pauseSession(with errorMessage: String? = nil) { diff --git a/TangemSdk/TangemSdk/Operations/Backup/BackupService.swift b/TangemSdk/TangemSdk/Operations/Backup/BackupService.swift index f90d9a7a..c83c4e85 100644 --- a/TangemSdk/TangemSdk/Operations/Backup/BackupService.swift +++ b/TangemSdk/TangemSdk/Operations/Backup/BackupService.swift @@ -39,8 +39,7 @@ public class BackupService { public var passcodeIsSet: Bool { repo.data.passcode != nil } public var primaryCardIsSet: Bool { repo.data.primaryCard != nil } public var primaryCard: PrimaryCard? { repo.data.primaryCard } - public var backupCardIds: [String] { repo.data.backupCards.map {$0.cardId} } - + public var backupCards: [BackupCard] { repo.data.backupCards } /// Perform additional compatibility checks while adding backup cards. Change this setting only if you understand what you do. public var skipCompatibilityChecks: Bool = false @@ -318,12 +317,19 @@ public class BackupService { } ) - let formattedCardId = CardIdFormatter(style: sdk.config.cardIdDisplayFormat).string(from: primaryCard.cardId) - - let initialMessage = formattedCardId.map { - Message(header: nil, - body: "backup_finalize_primary_card_message_format".localized($0)) + var initialMessage: Message? = nil + + if config.productType == .ring { + initialMessage = Message( + header: nil, + body:"backup_finalize_primary_ring_message".localized + ) + } else if let formattedCardId = CardIdFormatter(style: sdk.config.cardIdDisplayFormat).string(from: primaryCard.cardId) { + initialMessage = Message( + header: nil, + body: "backup_finalize_primary_card_message_format".localized(formattedCardId)) } + currentCommand = task @@ -382,12 +388,18 @@ public class BackupService { attestSignature: attestSignature, accessCode: accessCode, passcode: passcode) - - let formattedCardId = CardIdFormatter(style: sdk.config.cardIdDisplayFormat).string(from: backupCard.cardId) - - let initialMessage = formattedCardId.map { - Message(header: nil, - body: "backup_finalize_backup_card_message_format".localized($0)) + + var initialMessage: Message? = nil + + if config.productType == .ring { + initialMessage = Message( + header: nil, + body:"backup_finalize_backup_ring_message".localized + ) + } else if let formattedCardId = CardIdFormatter(style: sdk.config.cardIdDisplayFormat).string(from: backupCard.cardId) { + initialMessage = Message( + header: nil, + body: "backup_finalize_backup_card_message_format".localized(formattedCardId)) } currentCommand = command @@ -464,12 +476,14 @@ public struct PrimaryCard: Codable { var certificate: Data? } -struct BackupCard: Codable { - let cardId: String - let cardPublicKey: Data +public struct BackupCard: Codable { + public let cardId: String + public let cardPublicKey: Data + public let firmwareVersion: FirmwareVersion? // Optional for compatibility with interrupted backups + public let batchId: String? // Optional for compatibility with interrupted backups + let linkingKey: Data let attestSignature: Data - let firmwareVersion: FirmwareVersion? // Optional for compatibility with interrupted backups var certificate: Data? } diff --git a/TangemSdk/TangemSdk/Operations/Backup/StartBackupCardLinkingCommand.swift b/TangemSdk/TangemSdk/Operations/Backup/StartBackupCardLinkingCommand.swift index 8c9a4ab3..9fb84606 100644 --- a/TangemSdk/TangemSdk/Operations/Backup/StartBackupCardLinkingCommand.swift +++ b/TangemSdk/TangemSdk/Operations/Backup/StartBackupCardLinkingCommand.swift @@ -61,10 +61,13 @@ final class StartBackupCardLinkingCommand: Command { let decoder = TlvDecoder(tlv: tlv) - return BackupCard(cardId: try decoder.decode(.cardId), - cardPublicKey: card.cardPublicKey, - linkingKey: try decoder.decode(.backupCardLinkingKey), - attestSignature: try decoder.decode(.cardSignature), - firmwareVersion: card.firmwareVersion) + return BackupCard( + cardId: try decoder.decode(.cardId), + cardPublicKey: card.cardPublicKey, + firmwareVersion: card.firmwareVersion, + batchId: card.batchId, + linkingKey: try decoder.decode(.backupCardLinkingKey), + attestSignature: try decoder.decode(.cardSignature) + ) } } diff --git a/TangemSdk/TangemSdk/Operations/Command.swift b/TangemSdk/TangemSdk/Operations/Command.swift index 7f49f380..41b50f06 100644 --- a/TangemSdk/TangemSdk/Operations/Command.swift +++ b/TangemSdk/TangemSdk/Operations/Command.swift @@ -161,7 +161,7 @@ extension Command { let totalSd = session.environment.currentSecurityDelay! if totalSd > 0 { session.viewDelegate.setState(.delay(remaining: securityDelayResponse.remainingSeconds, total: totalSd)) - session.viewDelegate.showAlertMessage("view_delegate_security_delay_description".localized) + session.viewDelegate.showAlertMessage("view_delegate_security_delay_description_format".localized(session.environment.config.productType.localizedDescription)) } if securityDelayResponse.saveToFlash && session.environment.encryptionMode == .none { diff --git a/TangemSdk/TangemSdk/UI/Main/DefaultSessionViewDelegate.swift b/TangemSdk/TangemSdk/UI/Main/DefaultSessionViewDelegate.swift index 80a978fd..eee2355d 100644 --- a/TangemSdk/TangemSdk/UI/Main/DefaultSessionViewDelegate.swift +++ b/TangemSdk/TangemSdk/UI/Main/DefaultSessionViewDelegate.swift @@ -62,12 +62,12 @@ extension DefaultSessionViewDelegate: SessionViewDelegate { engine.playSuccess() } - func tagLost() { + func tagLost(message: String) { Log.view("Tag lost") if pinnedMessage == nil { pinnedMessage = reader.alertMessage } - showAlertMessage("view_delegate_scan_description".localized) + showAlertMessage(message) } func wrongCard(message: String) { diff --git a/TangemSdk/TangemSdk/UI/Main/SessionViewDelegate.swift b/TangemSdk/TangemSdk/UI/Main/SessionViewDelegate.swift index f295b15c..24ab9e34 100644 --- a/TangemSdk/TangemSdk/UI/Main/SessionViewDelegate.swift +++ b/TangemSdk/TangemSdk/UI/Main/SessionViewDelegate.swift @@ -18,7 +18,7 @@ public protocol SessionViewDelegate: AnyObject { func tagConnected() /// It is called when tag was lost - func tagLost() + func tagLost(message: String) func wrongCard(message: String) diff --git a/TangemSdk/TangemSdk/UI/TangemSdkStyle.swift b/TangemSdk/TangemSdk/UI/TangemSdkStyle.swift index ee7b4e89..c88fade5 100644 --- a/TangemSdk/TangemSdk/UI/TangemSdkStyle.swift +++ b/TangemSdk/TangemSdk/UI/TangemSdkStyle.swift @@ -72,7 +72,10 @@ public extension TangemSdkStyle { enum ScanTagImage { /// Generic card provided by the SDK case genericCard - + + /// Generic ring provided by the SDK + case genericRing + /// A custom tag made out of a UIImage instance. /// The image can be shifted vertically from the standard position by specifying `verticalOffset`. /// Note that the width of the image will be limited to a certain size, while the height will be determined by the aspect ratio of the image. diff --git a/TangemSdk/TangemSdk/UI/Views/Scan/ReadView.swift b/TangemSdk/TangemSdk/UI/Views/Scan/ReadView.swift index 4f84d92d..04510abc 100644 --- a/TangemSdk/TangemSdk/UI/Views/Scan/ReadView.swift +++ b/TangemSdk/TangemSdk/UI/Views/Scan/ReadView.swift @@ -47,6 +47,8 @@ struct ReadView: View { switch style.scanTagImage { case .genericCard: CardView(cardColor: style.colors.cardColor, starsColor: style.colors.starsColor) + case .genericRing: + Image("ring_shape_scan") case .image(let uiImage, let verticalOffset): Image(uiImage: uiImage) .resizable()