diff --git a/ui/BankingiOSApp/BankingiOSApp/Base.lproj/Localizable.strings b/ui/BankingiOSApp/BankingiOSApp/Base.lproj/Localizable.strings index 283edffb..7f1282cf 100644 --- a/ui/BankingiOSApp/BankingiOSApp/Base.lproj/Localizable.strings +++ b/ui/BankingiOSApp/BankingiOSApp/Base.lproj/Localizable.strings @@ -218,6 +218,7 @@ Unfortunately, Bankmeister cannot know whether a bank charges for real-time tran "Protect App Settings Dialog title" = "App protection"; "FaceID" = "FaceID"; "TouchID" = "TouchID"; +"Authenticate to encrypt data with %@" = "Authenticate to encrypt data with %@"; "Password" = "Password"; "Unprotected" = "Unprotected"; "Authenticate with TouchID" = "Authenticate with TouchID"; diff --git a/ui/BankingiOSApp/BankingiOSApp/Security/AuthenticationService.swift b/ui/BankingiOSApp/BankingiOSApp/Security/AuthenticationService.swift index b9738a4d..78aa4b02 100644 --- a/ui/BankingiOSApp/BankingiOSApp/Security/AuthenticationService.swift +++ b/ui/BankingiOSApp/BankingiOSApp/Security/AuthenticationService.swift @@ -215,8 +215,8 @@ class AuthenticationService { } - func authenticateUserWithBiometric(_ authenticationResult: @escaping (Bool, String?) -> Void) { - biometricAuthenticationService.authenticate("Authenticate with biometrics to unlock app reason", authenticationResult) + func authenticateUserWithBiometric(_ prompt: String, _ authenticationResult: @escaping (Bool, String?) -> Void) { + biometricAuthenticationService.authenticate(prompt, authenticationResult) } func authenticateUserWithPassword(_ enteredPassword: String, _ authenticationResult: @escaping (Bool, String?) -> Void) { diff --git a/ui/BankingiOSApp/BankingiOSApp/de.lproj/Localizable.strings b/ui/BankingiOSApp/BankingiOSApp/de.lproj/Localizable.strings index 3d0cedd9..3a17d758 100644 --- a/ui/BankingiOSApp/BankingiOSApp/de.lproj/Localizable.strings +++ b/ui/BankingiOSApp/BankingiOSApp/de.lproj/Localizable.strings @@ -219,6 +219,7 @@ Ob eine Bank Gebühren für Echtzeitüberweisungen erhebt, kann Bankmeister leid "Protect App Settings Dialog title" = "Appzugangsschutz"; "FaceID" = "FaceID"; "TouchID" = "TouchID"; +"Authenticate to encrypt data with %@" = "Authentifizieren Sie sich um Ihre Daten mit %@ zu schützen"; "Password" = "Passwort"; "Unprotected" = "Ungeschützt"; "Authenticate with TouchID" = "Mit TouchID authentifizieren"; diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/LoginDialog.swift b/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/LoginDialog.swift index e17bc2db..445d9e04 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/LoginDialog.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/LoginDialog.swift @@ -94,7 +94,7 @@ struct LoginDialog: View { private func loginWithBiometricAuthentication() { - authenticationService.authenticateUserWithBiometric(self.handleAuthenticationResult) + authenticationService.authenticateUserWithBiometric("Authenticate with biometrics to unlock app reason", self.handleAuthenticationResult) } private func loginWithPasswordOnReturnKeyPress() -> Bool { diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/ProtectAppSettingsDialog.swift b/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/ProtectAppSettingsDialog.swift index 0c5825e8..85c71e6a 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/ProtectAppSettingsDialog.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/ProtectAppSettingsDialog.swift @@ -144,12 +144,7 @@ struct ProtectAppSettingsDialog: View { private func getAuthenticationTypeLabel(_ type: AuthenticationType) -> LocalizedStringKey { switch type { case .biometric: - if authenticationService.deviceSupportsTouchID { - return "TouchID" - } - else { - return "FaceID" - } + return LocalizedStringKey(supportedBiometricAuthenticationTitle) case .password: return "Password" default: @@ -157,6 +152,15 @@ struct ProtectAppSettingsDialog: View { } } + private var supportedBiometricAuthenticationTitle: String { + if authenticationService.deviceSupportsTouchID { + return "TouchID" + } + else { + return "FaceID" + } + } + private func selectedAuthenticationTypeChanged(_ type: AuthenticationType) { isFaceIDSelected = false isTouchIDSelected = false @@ -184,7 +188,7 @@ struct ProtectAppSettingsDialog: View { } private func doBiometricAuthentication() { - authenticationService.authenticateUserWithBiometric { success, errorMessage in + authenticationService.authenticateUserWithBiometric("Authenticate to encrypt data with %@".localize(supportedBiometricAuthenticationTitle.localize())) { success, errorMessage in self.successfullyAuthenticatedWithBiometricAuthentication = success } }