diff --git a/ui/BankingiOSApp/BankingiOSApp/Base.lproj/Localizable.strings b/ui/BankingiOSApp/BankingiOSApp/Base.lproj/Localizable.strings index 9bd582a7..6260966f 100644 --- a/ui/BankingiOSApp/BankingiOSApp/Base.lproj/Localizable.strings +++ b/ui/BankingiOSApp/BankingiOSApp/Base.lproj/Localizable.strings @@ -49,6 +49,8 @@ "TAN medium" = "TAN medium"; "TAN hint from your bank:" = "Hint from your bank:"; "Enter TAN:" = "TAN"; +"Decoding error" = "Decoding error"; +"Could not decode TAN challenge. Error: %@." = "Could not decode flicker code or QR code / PhotoTan. Most likely an internal error:\n%@."; "TAN medium change" = "TAN medium change"; "TAN medium successfully changed to %@." = "TAN medium successfully changed to '%@'."; "Could not change TAN medium to %@. Error: %@." = "Could not change TAN medium to '%@'.\n\nError message from your bank:\n\n%@."; diff --git a/ui/BankingiOSApp/BankingiOSApp/de.lproj/Localizable.strings b/ui/BankingiOSApp/BankingiOSApp/de.lproj/Localizable.strings index 2651d069..1ea59098 100644 --- a/ui/BankingiOSApp/BankingiOSApp/de.lproj/Localizable.strings +++ b/ui/BankingiOSApp/BankingiOSApp/de.lproj/Localizable.strings @@ -49,6 +49,8 @@ "TAN medium" = "TAN Medium"; "TAN hint from your bank:" = "Hinweis Ihrer Bank:"; "Enter TAN:" = "TAN"; +"Decoding error" = "Dekodierungsfehler"; +"Could not decode TAN challenge. Error: %@." = "Flicker code oder QR code / PhotoTan konnten nicht dekodiert werden. Sehr wahrscheinlich ein interner Fehler:\n%@."; "TAN medium change" = "TAN Medium Wechsel"; "TAN medium successfully changed to %@." = "TAN Medium erfolgreich zu '%@' geändert."; "Could not change TAN medium to %@. Error: %@." = "TAN medium konnte nicht zu '%@' geändert werden.\n\nFehlermeldung Ihrer Bank:\n\n%@."; diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/views/EnterTanDialog.swift b/ui/BankingiOSApp/BankingiOSApp/ui/views/EnterTanDialog.swift index 8d12bb52..a32296a7 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/views/EnterTanDialog.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/views/EnterTanDialog.swift @@ -77,6 +77,13 @@ struct EnterTanDialog: View { self.showFlickerCodeTanView = tanChallenge is FlickerCodeTanChallenge self.showImageTanView = tanChallenge is ImageTanChallenge + + if let decodingError = (tanChallenge as? FlickerCodeTanChallenge)?.flickerCode.decodingError { + showDecodingTanChallengeFailedErrorDelayed(decodingError) + } + if let decodingError = (tanChallenge as? ImageTanChallenge)?.image.decodingError { + showDecodingTanChallengeFailedErrorDelayed(decodingError) + } } @@ -177,6 +184,21 @@ struct EnterTanDialog: View { } } + /** + This method gets called right on start up before dialog is shown -> Alert would get displayed before dialog and therefore covered by dialog -> delay displaying alert. + */ + private func showDecodingTanChallengeFailedErrorDelayed(_ error: KotlinException?) { + DispatchQueue.main.asyncAfter(deadline: .now() + 1) { + self.showDecodingTanChallengeFailedError(error) + } + } + + private func showDecodingTanChallengeFailedError(_ error: KotlinException?) { + if let errorMessage = error?.message { + self.errorMessage = Message(title: "Decoding error", message: "Could not decode TAN challenge. Error: \(errorMessage).", primaryButton: .ok()) + } + } + private func enteringTanDone() { let companion = EnterTanResult.Companion()