diff --git a/ui/BankingiOSApp/BankingiOSApp/Base.lproj/Localizable.strings b/ui/BankingiOSApp/BankingiOSApp/Base.lproj/Localizable.strings index 2353672e..cd8c63f2 100644 --- a/ui/BankingiOSApp/BankingiOSApp/Base.lproj/Localizable.strings +++ b/ui/BankingiOSApp/BankingiOSApp/Base.lproj/Localizable.strings @@ -21,6 +21,9 @@ "Select Bank Dialog Title" = "Select your bank ..."; "Search by bank code, bank name or city" = "Search by bank code, bank name or city"; +"Bank does not support FinTS 3.0" = "Bank does not support FinTS 3.0"; +"%@ does not support FinTS 3.0." = "%@ does not support FinTS 3.0.\n\nIn this app only banks supporting the German banking standard FinTS 3.0 can be used."; + /* AddAccountDialog */ diff --git a/ui/BankingiOSApp/BankingiOSApp/de.lproj/Localizable.strings b/ui/BankingiOSApp/BankingiOSApp/de.lproj/Localizable.strings index 904ca1ab..ce966590 100644 --- a/ui/BankingiOSApp/BankingiOSApp/de.lproj/Localizable.strings +++ b/ui/BankingiOSApp/BankingiOSApp/de.lproj/Localizable.strings @@ -21,6 +21,9 @@ "Select Bank Dialog Title" = "Bank auswählen"; "Search by bank code, bank name or city" = "Suche mittels Bankleitzahl, Bankname oder Ort"; +"Bank does not support FinTS 3.0" = "FinTS 3.0 wird von Bank nicht unterstützt"; +"%@ does not support FinTS 3.0." = "%@ unterstützt FinTS 3.0 nicht.\n\nIn dieser App können nur Banken verwendet werden, die den deutschen Online-Banking Standard FinTS 3.0 unterstützen."; + /* AddAccountDialog */ diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/views/SelectBankDialog.swift b/ui/BankingiOSApp/BankingiOSApp/ui/views/SelectBankDialog.swift index 526d3bbf..24b7e052 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/views/SelectBankDialog.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/views/SelectBankDialog.swift @@ -25,6 +25,9 @@ struct SelectBankDialog: View { @State private var searchResult: [BankInfo] + @State private var errorMessage: Message? = nil + + init(_ selectedBank: Binding) { self._selectedBank = selectedBank @@ -55,12 +58,15 @@ struct SelectBankDialog: View { // TODO: showing only the first 100 items is a workaround as SwiftUI tries to compare the two lists (to be able to animate them!) which takes extremely long for the full data set List(searchResult.prefix(100), id: \.self) { bank in BankInfoListItem(bank: bank) - .onTapGesture { + .onTapGesture { self.handleSelectedBank(bank) } } } } + .alert(item: $errorMessage) { message in + Alert(title: message.title, message: message.message, dismissButton: message.primaryButton) + } .showNavigationBarTitle("Select Bank Dialog Title") } @@ -70,9 +76,16 @@ struct SelectBankDialog: View { } private func handleSelectedBank(_ bank: BankInfo) { - self.selectedBank = bank + if bank.supportsFinTs3_0 { + self.selectedBank = bank - presentation.wrappedValue.dismiss() + presentation.wrappedValue.dismiss() + } + else { + self.selectedBank = nil + + self.errorMessage = Message(title: Text("Bank does not support FinTS 3.0"), message: Text("\(bank.name) does not support FinTS 3.0.")) + } } }