[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taler-ios] 12/25: KYC - wip
From: |
gnunet |
Subject: |
[taler-taler-ios] 12/25: KYC - wip |
Date: |
Mon, 06 Nov 2023 20:40:19 +0100 |
This is an automated email from the git hooks/post-receive script.
marc-stibane pushed a commit to branch master
in repository taler-ios.
commit 1c8b9fdac4b6aaa1495ea101cc54007abde23d47
Author: Marc Stibane <marc@taler.net>
AuthorDate: Sat Nov 4 08:27:12 2023 +0100
KYC - wip
---
TalerWallet1/Model/Transaction.swift | 1 +
TalerWallet1/Views/Main/MainView.swift | 35 +++++++++++++++++++++++++++++++++-
2 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/TalerWallet1/Model/Transaction.swift
b/TalerWallet1/Model/Transaction.swift
index 823e1d7..5c9f16e 100644
--- a/TalerWallet1/Model/Transaction.swift
+++ b/TalerWallet1/Model/Transaction.swift
@@ -150,6 +150,7 @@ struct TransactionCommon: Decodable, Sendable {
var transactionId: String
var timestamp: Timestamp
var txActions: [TxAction]
+ var kycUrl: String?
func localizedType(_ type: TransactionType) -> String {
switch type {
diff --git a/TalerWallet1/Views/Main/MainView.swift
b/TalerWallet1/Views/Main/MainView.swift
index 56b166e..0edd3ef 100644
--- a/TalerWallet1/Views/Main/MainView.swift
+++ b/TalerWallet1/Views/Main/MainView.swift
@@ -89,6 +89,19 @@ extension MainView {
let settingsTitle = String(localized: "TitleSettings", defaultValue:
"Settings")
#if TABBAR // Taler Wallet
@State private var selectedTab: Tab = .balances
+ @State private var showKycAlert: Bool = false
+
+ private var openKycButton: some View {
+ Button("KYC") {
+ showKycAlert = false
+// UIApplication.shared.open(URL(string:
UIApplication.openSettingsURLString)!)
+ }
+ }
+ private var dismissAlertButton: some View {
+ Button("Cancel", role: .cancel) {
+ showKycAlert = false
+ }
+ }
private func tabSelection() -> Binding<Tab> {
Binding { //this is the get block
@@ -220,7 +233,27 @@ extension MainView {
hamburgerAction: hamburgerAction)
}
#endif
- }
+ } .onNotification(.TransactionStateTransition) { notification in
+ // show an alert with the KYC link (button) which opens in Safari
+ if let transition =
notification.userInfo?[TRANSACTIONTRANSITION] as? TransactionTransition {
+ if transition.newTxState.major == .pending {
+ if let newMinor = transition.newTxState.minor {
+ if newMinor == .kyc { // user did confirm on
bank website
+ logger.log(".onNotification(): KYC required")
+ showKycAlert = true
+ }
+ }
+ }
+ } else { // should never happen
+ logger.error("Yikes! TransactionStateTransition without
transition")
+// symLog.log(notification.userInfo as Any)
+ }
+ }
+ .alert("You need to pass a KYC procedure",
+ isPresented: $showKycAlert,
+ actions: { openKycButton
+ dismissAlertButton },
+ message: { Text("Tap the button to go to the KYC website.")
})
.onNotification(.BalanceChange) { notification in
// reload balances on receiving BalanceChange notification ...
logger.info(".onNotification(.BalanceChange) ==> reload")
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-taler-ios] 18/25: Default for Sound & Haptics ON, (continued)
- [taler-taler-ios] 18/25: Default for Sound & Haptics ON, gnunet, 2023/11/06
- [taler-taler-ios] 23/25: L10N, EMPTYSTRING, gnunet, 2023/11/06
- [taler-taler-ios] 10/25: Use System Alert for iOS16+, gnunet, 2023/11/06
- [taler-taler-ios] 14/25: Blue Logo, gnunet, 2023/11/06
- [taler-taler-ios] 25/25: Bump version to 0.9.3 (24), gnunet, 2023/11/06
- [taler-taler-ios] 15/25: cleanup sortedTransactions, gnunet, 2023/11/06
- [taler-taler-ios] 07/25: IncompleteRowV, gnunet, 2023/11/06
- [taler-taler-ios] 09/25: Logger, gnunet, 2023/11/06
- [taler-taler-ios] 19/25: SendDone: Prevent double execution, gnunet, 2023/11/06
- [taler-taler-ios] 20/25: Debugging, gnunet, 2023/11/06
- [taler-taler-ios] 12/25: KYC - wip,
gnunet <=
- [taler-taler-ios] 08/25: Accessibility, gnunet, 2023/11/06
- [taler-taler-ios] 17/25: ThreeAmountsV cleanup, gnunet, 2023/11/06
- [taler-taler-ios] 11/25: cleanup, gnunet, 2023/11/06
- [taler-taler-ios] 22/25: Announce, gnunet, 2023/11/06