From c47e104fe6aa401b5395e04964d8f6e42fd55ecb Mon Sep 17 00:00:00 2001 From: Gleb Kulik Date: Tue, 25 Mar 2025 16:46:11 +0100 Subject: [PATCH 001/110] feat(GiniBankSDK): Add GiniUtilites dependency. UITextField+Utils PP-1079 --- BankSDK/GiniBankSDK/Package.swift | 3 ++- .../Core/Skonto/Components/PriceTextField.swift | 1 + .../Extensions/UIKit/UITextField.swift | 17 ----------------- 3 files changed, 3 insertions(+), 18 deletions(-) delete mode 100644 BankSDK/GiniBankSDK/Sources/GiniBankSDK/Extensions/UIKit/UITextField.swift diff --git a/BankSDK/GiniBankSDK/Package.swift b/BankSDK/GiniBankSDK/Package.swift index 41d20ba9ce..3ab78109a7 100644 --- a/BankSDK/GiniBankSDK/Package.swift +++ b/BankSDK/GiniBankSDK/Package.swift @@ -17,6 +17,7 @@ let package = Package( // Dependencies declare other packages that this package depends on. // .package(url: /* package url */, from: "1.0.0"), .package(name: "GiniCaptureSDK", path: "../../CaptureSDK/GiniCaptureSDK"), + .package(name: "GiniUtilites", path: "../../GiniComponents/GiniUtilites") ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. @@ -24,7 +25,7 @@ let package = Package( .target( name: "GiniBankSDK", - dependencies: ["GiniCaptureSDK"]), + dependencies: ["GiniCaptureSDK", "GiniUtilites"]), .testTarget( name: "GiniBankSDKTests", dependencies: ["GiniBankSDK"], diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Components/PriceTextField.swift b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Components/PriceTextField.swift index e3c0d2723b..03612494f3 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Components/PriceTextField.swift +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Components/PriceTextField.swift @@ -5,6 +5,7 @@ // import UIKit +import GiniUtilites protocol PriceTextFieldDelegate: AnyObject { func priceTextField(_ textField: PriceTextField, didChangePrice editedText: String) diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Extensions/UIKit/UITextField.swift b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Extensions/UIKit/UITextField.swift deleted file mode 100644 index a3542a6d76..0000000000 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Extensions/UIKit/UITextField.swift +++ /dev/null @@ -1,17 +0,0 @@ -// -// UITextField.swift -// GiniBank -// -// Created by Maciej Trybilo on 18.12.19. -// - -import UIKit - -public extension UITextField { - func moveSelectedTextRange(from position: UITextPosition, to offset: Int) { - if let newSelectedRangeFromTo = self.position(from: position, offset: offset), - let newSelectedRange = self.textRange(from: newSelectedRangeFromTo, to: newSelectedRangeFromTo) { - self.selectedTextRange = newSelectedRange - } - } -} From 57cca046f7f443626a030f58cf5b3940ebd46f16 Mon Sep 17 00:00:00 2001 From: Gleb Kulik Date: Tue, 25 Mar 2025 16:46:33 +0100 Subject: [PATCH 002/110] feat(GiniBankSDKExample): Add GiniUtilites dependency. UITextField+Utils PP-1079 --- .../GiniBankSDKExample.xcodeproj/project.pbxproj | 4 ---- .../Helpers/UITextField+Utils.swift | 13 ------------- .../PaymentViewController.swift | 10 ---------- 3 files changed, 27 deletions(-) delete mode 100644 BankSDK/GiniBankSDKExample/GiniBankSDKExampleBank/Helpers/UITextField+Utils.swift diff --git a/BankSDK/GiniBankSDKExample/GiniBankSDKExample.xcodeproj/project.pbxproj b/BankSDK/GiniBankSDKExample/GiniBankSDKExample.xcodeproj/project.pbxproj index e79168971e..0e19d518ff 100644 --- a/BankSDK/GiniBankSDKExample/GiniBankSDKExample.xcodeproj/project.pbxproj +++ b/BankSDK/GiniBankSDKExample/GiniBankSDKExample.xcodeproj/project.pbxproj @@ -188,7 +188,6 @@ F4807F542641347F00F30FF3 /* UIView+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4807F532641347F00F30FF3 /* UIView+Utils.swift */; }; F4807F7426416A5200F30FF3 /* IBANValidator.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4807F7326416A5200F30FF3 /* IBANValidator.swift */; }; F4807F9026416E2E00F30FF3 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = F4807F9226416E2E00F30FF3 /* Localizable.strings */; }; - F4807F9F2641709500F30FF3 /* UITextField+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4807F9E2641709500F30FF3 /* UITextField+Utils.swift */; }; F4807FB52641713700F30FF3 /* Amount.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4807FB42641713700F30FF3 /* Amount.swift */; }; F4807FC22641830D00F30FF3 /* CredentialsManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4807FC12641830D00F30FF3 /* CredentialsManager.swift */; }; F4807FC9264183C000F30FF3 /* Credentials.plist in Resources */ = {isa = PBXBuildFile; fileRef = F4807FC8264183C000F30FF3 /* Credentials.plist */; }; @@ -428,7 +427,6 @@ F4807F7326416A5200F30FF3 /* IBANValidator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IBANValidator.swift; sourceTree = ""; }; F4807F9126416E2E00F30FF3 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = ""; }; F4807F9826416E3300F30FF3 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; - F4807F9E2641709500F30FF3 /* UITextField+Utils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UITextField+Utils.swift"; sourceTree = ""; }; F4807FB42641713700F30FF3 /* Amount.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Amount.swift; sourceTree = ""; }; F4807FC12641830D00F30FF3 /* CredentialsManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CredentialsManager.swift; sourceTree = ""; }; F4807FC8264183C000F30FF3 /* Credentials.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Credentials.plist; sourceTree = ""; }; @@ -1029,7 +1027,6 @@ F4807FC12641830D00F30FF3 /* CredentialsManager.swift */, F4807FB42641713700F30FF3 /* Amount.swift */, F4807F532641347F00F30FF3 /* UIView+Utils.swift */, - F4807F9E2641709500F30FF3 /* UITextField+Utils.swift */, ); path = Helpers; sourceTree = ""; @@ -1433,7 +1430,6 @@ buildActionMask = 2147483647; files = ( F4807C3B263C20BA00F30FF3 /* PaymentViewController.swift in Sources */, - F4807F9F2641709500F30FF3 /* UITextField+Utils.swift in Sources */, F4807F7426416A5200F30FF3 /* IBANValidator.swift in Sources */, F4807FB52641713700F30FF3 /* Amount.swift in Sources */, F4807FC22641830D00F30FF3 /* CredentialsManager.swift in Sources */, diff --git a/BankSDK/GiniBankSDKExample/GiniBankSDKExampleBank/Helpers/UITextField+Utils.swift b/BankSDK/GiniBankSDKExample/GiniBankSDKExampleBank/Helpers/UITextField+Utils.swift deleted file mode 100644 index f45875b7fc..0000000000 --- a/BankSDK/GiniBankSDKExample/GiniBankSDKExampleBank/Helpers/UITextField+Utils.swift +++ /dev/null @@ -1,13 +0,0 @@ -// -// UITextField+Utils.swift -// Bank -// -// Created by Nadya Karaban on 04.05.21. -// - -import UIKit -public extension UITextField { - var isReallyEmpty: Bool { - return text?.trimmingCharacters(in: .whitespaces).isEmpty ?? true - } -} diff --git a/BankSDK/GiniBankSDKExample/GiniBankSDKExampleBank/PaymentViewController.swift b/BankSDK/GiniBankSDKExample/GiniBankSDKExampleBank/PaymentViewController.swift index b88b38c5c1..4856b6d7ef 100644 --- a/BankSDK/GiniBankSDKExample/GiniBankSDKExampleBank/PaymentViewController.swift +++ b/BankSDK/GiniBankSDKExample/GiniBankSDKExampleBank/PaymentViewController.swift @@ -422,13 +422,3 @@ extension PaymentViewController { present(alertController, animated: true, completion: nil) } } - -public extension UITextField { - - func moveSelectedTextRange(from position: UITextPosition, to offset: Int) { - if let newSelectedRangeFromTo = self.position(from: position, offset: offset), - let newSelectedRange = self.textRange(from: newSelectedRangeFromTo, to: newSelectedRangeFromTo) { - self.selectedTextRange = newSelectedRange - } - } -} From b3989524ba0430eae433bed7fa41a57bda690420 Mon Sep 17 00:00:00 2001 From: Gleb Kulik Date: Tue, 25 Mar 2025 16:46:49 +0100 Subject: [PATCH 003/110] feat(GiniBankSDKPinningExample): Add GiniUtilites dependency. UITextField+Utils PP-1079 --- .../Helpers/UITextField+Utils.swift | 13 ------------- .../PaymentViewController.swift | 11 +---------- .../project.pbxproj | 4 ---- 3 files changed, 1 insertion(+), 27 deletions(-) delete mode 100644 BankSDK/GiniBankSDKPinningExample/GiniBankSDKExampleBank/Helpers/UITextField+Utils.swift diff --git a/BankSDK/GiniBankSDKPinningExample/GiniBankSDKExampleBank/Helpers/UITextField+Utils.swift b/BankSDK/GiniBankSDKPinningExample/GiniBankSDKExampleBank/Helpers/UITextField+Utils.swift deleted file mode 100644 index f45875b7fc..0000000000 --- a/BankSDK/GiniBankSDKPinningExample/GiniBankSDKExampleBank/Helpers/UITextField+Utils.swift +++ /dev/null @@ -1,13 +0,0 @@ -// -// UITextField+Utils.swift -// Bank -// -// Created by Nadya Karaban on 04.05.21. -// - -import UIKit -public extension UITextField { - var isReallyEmpty: Bool { - return text?.trimmingCharacters(in: .whitespaces).isEmpty ?? true - } -} diff --git a/BankSDK/GiniBankSDKPinningExample/GiniBankSDKExampleBank/PaymentViewController.swift b/BankSDK/GiniBankSDKPinningExample/GiniBankSDKExampleBank/PaymentViewController.swift index be01787203..f0a2500593 100644 --- a/BankSDK/GiniBankSDKPinningExample/GiniBankSDKExampleBank/PaymentViewController.swift +++ b/BankSDK/GiniBankSDKPinningExample/GiniBankSDKExampleBank/PaymentViewController.swift @@ -9,6 +9,7 @@ import GiniBankAPILibrary import GiniBankSDK import GiniCaptureSDK import UIKit +import GiniUtilites class PaymentViewController: UIViewController { @IBOutlet var receipient: UITextField! @@ -413,13 +414,3 @@ extension PaymentViewController { present(alertController, animated: true, completion: nil) } } - -public extension UITextField { - - func moveSelectedTextRange(from position: UITextPosition, to offset: Int) { - if let newSelectedRangeFromTo = self.position(from: position, offset: offset), - let newSelectedRange = self.textRange(from: newSelectedRangeFromTo, to: newSelectedRangeFromTo) { - self.selectedTextRange = newSelectedRange - } - } -} diff --git a/BankSDK/GiniBankSDKPinningExample/GiniBankSDKPinningExample.xcodeproj/project.pbxproj b/BankSDK/GiniBankSDKPinningExample/GiniBankSDKPinningExample.xcodeproj/project.pbxproj index 59564a7b3f..d7accd10a0 100644 --- a/BankSDK/GiniBankSDKPinningExample/GiniBankSDKPinningExample.xcodeproj/project.pbxproj +++ b/BankSDK/GiniBankSDKPinningExample/GiniBankSDKPinningExample.xcodeproj/project.pbxproj @@ -38,7 +38,6 @@ F4807F542641347F00F30FF3 /* UIView+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4807F532641347F00F30FF3 /* UIView+Utils.swift */; }; F4807F7426416A5200F30FF3 /* IBANValidator.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4807F7326416A5200F30FF3 /* IBANValidator.swift */; }; F4807F9026416E2E00F30FF3 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = F4807F9226416E2E00F30FF3 /* Localizable.strings */; }; - F4807F9F2641709500F30FF3 /* UITextField+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4807F9E2641709500F30FF3 /* UITextField+Utils.swift */; }; F4807FB52641713700F30FF3 /* Amount.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4807FB42641713700F30FF3 /* Amount.swift */; }; F4807FC22641830D00F30FF3 /* CredentialsManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4807FC12641830D00F30FF3 /* CredentialsManager.swift */; }; F4807FC9264183C000F30FF3 /* Credentials.plist in Resources */ = {isa = PBXBuildFile; fileRef = F4807FC8264183C000F30FF3 /* Credentials.plist */; }; @@ -118,7 +117,6 @@ F4807F7326416A5200F30FF3 /* IBANValidator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IBANValidator.swift; sourceTree = ""; }; F4807F9126416E2E00F30FF3 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = ""; }; F4807F9826416E3300F30FF3 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; - F4807F9E2641709500F30FF3 /* UITextField+Utils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UITextField+Utils.swift"; sourceTree = ""; }; F4807FB42641713700F30FF3 /* Amount.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Amount.swift; sourceTree = ""; }; F4807FC12641830D00F30FF3 /* CredentialsManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CredentialsManager.swift; sourceTree = ""; }; F4807FC8264183C000F30FF3 /* Credentials.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Credentials.plist; sourceTree = ""; }; @@ -255,7 +253,6 @@ F4807FC12641830D00F30FF3 /* CredentialsManager.swift */, F4807FB42641713700F30FF3 /* Amount.swift */, F4807F532641347F00F30FF3 /* UIView+Utils.swift */, - F4807F9E2641709500F30FF3 /* UITextField+Utils.swift */, ); path = Helpers; sourceTree = ""; @@ -507,7 +504,6 @@ buildActionMask = 2147483647; files = ( F4807C3B263C20BA00F30FF3 /* PaymentViewController.swift in Sources */, - F4807F9F2641709500F30FF3 /* UITextField+Utils.swift in Sources */, F4807F7426416A5200F30FF3 /* IBANValidator.swift in Sources */, F4807FB52641713700F30FF3 /* Amount.swift in Sources */, F4807FC22641830D00F30FF3 /* CredentialsManager.swift in Sources */, From 36608be2a3a5737862940279cbf8fd7003ca8780 Mon Sep 17 00:00:00 2001 From: Gleb Kulik Date: Tue, 25 Mar 2025 16:53:13 +0100 Subject: [PATCH 004/110] feat(GiniBankSDKExample): remove UIView+Utils PP-1079 --- .../project.pbxproj | 4 -- .../Helpers/UIView+Utils.swift | 39 ------------------- 2 files changed, 43 deletions(-) delete mode 100644 BankSDK/GiniBankSDKExample/GiniBankSDKExampleBank/Helpers/UIView+Utils.swift diff --git a/BankSDK/GiniBankSDKExample/GiniBankSDKExample.xcodeproj/project.pbxproj b/BankSDK/GiniBankSDKExample/GiniBankSDKExample.xcodeproj/project.pbxproj index 0e19d518ff..3e1a4034c2 100644 --- a/BankSDK/GiniBankSDKExample/GiniBankSDKExample.xcodeproj/project.pbxproj +++ b/BankSDK/GiniBankSDKExample/GiniBankSDKExample.xcodeproj/project.pbxproj @@ -185,7 +185,6 @@ F4807C40263C20BB00F30FF3 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F4807C3F263C20BB00F30FF3 /* Assets.xcassets */; }; F4807C43263C20BB00F30FF3 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F4807C41263C20BB00F30FF3 /* LaunchScreen.storyboard */; }; F4807F342640177600F30FF3 /* PaymentViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4807F332640177500F30FF3 /* PaymentViewModel.swift */; }; - F4807F542641347F00F30FF3 /* UIView+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4807F532641347F00F30FF3 /* UIView+Utils.swift */; }; F4807F7426416A5200F30FF3 /* IBANValidator.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4807F7326416A5200F30FF3 /* IBANValidator.swift */; }; F4807F9026416E2E00F30FF3 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = F4807F9226416E2E00F30FF3 /* Localizable.strings */; }; F4807FB52641713700F30FF3 /* Amount.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4807FB42641713700F30FF3 /* Amount.swift */; }; @@ -423,7 +422,6 @@ F4807C42263C20BB00F30FF3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; F4807C44263C20BB00F30FF3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; F4807F332640177500F30FF3 /* PaymentViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PaymentViewModel.swift; sourceTree = ""; }; - F4807F532641347F00F30FF3 /* UIView+Utils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+Utils.swift"; sourceTree = ""; }; F4807F7326416A5200F30FF3 /* IBANValidator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IBANValidator.swift; sourceTree = ""; }; F4807F9126416E2E00F30FF3 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = ""; }; F4807F9826416E3300F30FF3 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; @@ -1026,7 +1024,6 @@ F4807F7326416A5200F30FF3 /* IBANValidator.swift */, F4807FC12641830D00F30FF3 /* CredentialsManager.swift */, F4807FB42641713700F30FF3 /* Amount.swift */, - F4807F532641347F00F30FF3 /* UIView+Utils.swift */, ); path = Helpers; sourceTree = ""; @@ -1434,7 +1431,6 @@ F4807FB52641713700F30FF3 /* Amount.swift in Sources */, F4807FC22641830D00F30FF3 /* CredentialsManager.swift in Sources */, F4807F342640177600F30FF3 /* PaymentViewModel.swift in Sources */, - F4807F542641347F00F30FF3 /* UIView+Utils.swift in Sources */, F4807C37263C20BA00F30FF3 /* AppDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/BankSDK/GiniBankSDKExample/GiniBankSDKExampleBank/Helpers/UIView+Utils.swift b/BankSDK/GiniBankSDKExample/GiniBankSDKExampleBank/Helpers/UIView+Utils.swift deleted file mode 100644 index b8200057fd..0000000000 --- a/BankSDK/GiniBankSDKExample/GiniBankSDKExampleBank/Helpers/UIView+Utils.swift +++ /dev/null @@ -1,39 +0,0 @@ -// -// UIView+Utils.swift -// Bank -// -// Created by Nadya Karaban on 04.05.21. -// - -import Foundation -import UIKit -// MARK: - Adds loading indicator to any UIView, configurable with UIActivityIndicatorView.Style, color and scale - -public extension UIView { - func showLoading(style: UIActivityIndicatorView.Style? = .whiteLarge, color: UIColor? = .orange, scale: CGFloat? = 1.0) { - let loading = UIActivityIndicatorView(style: style ?? .whiteLarge) - if let color = color { - loading.color = color - } - loading.contentScaleFactor = scale ?? 1.0 - loading.translatesAutoresizingMaskIntoConstraints = false - loading.startAnimating() - loading.hidesWhenStopped = true - addSubview(loading) - loading.centerYAnchor.constraint(equalTo: centerYAnchor).isActive = true - loading.centerXAnchor.constraint(equalTo: centerXAnchor).isActive = true - } - - func stopLoading() { - removeActivityIndicator() - } - - func removeActivityIndicator() { - let activityIndicators = subviews.filter { $0 is UIActivityIndicatorView } as? [UIActivityIndicatorView] - - activityIndicators?.forEach { activityIndicator in - activityIndicator.stopAnimating() - activityIndicator.removeFromSuperview() - } - } -} From d49eb4e4294fbc422579f62948f3d00aace39f69 Mon Sep 17 00:00:00 2001 From: Gleb Kulik Date: Tue, 25 Mar 2025 16:53:25 +0100 Subject: [PATCH 005/110] feat(GiniBankSDKPinningExample): remove UIView+Utils PP-1079 --- .../Helpers/UIView+Utils.swift | 39 ------------------- .../project.pbxproj | 4 -- 2 files changed, 43 deletions(-) delete mode 100644 BankSDK/GiniBankSDKPinningExample/GiniBankSDKExampleBank/Helpers/UIView+Utils.swift diff --git a/BankSDK/GiniBankSDKPinningExample/GiniBankSDKExampleBank/Helpers/UIView+Utils.swift b/BankSDK/GiniBankSDKPinningExample/GiniBankSDKExampleBank/Helpers/UIView+Utils.swift deleted file mode 100644 index b8200057fd..0000000000 --- a/BankSDK/GiniBankSDKPinningExample/GiniBankSDKExampleBank/Helpers/UIView+Utils.swift +++ /dev/null @@ -1,39 +0,0 @@ -// -// UIView+Utils.swift -// Bank -// -// Created by Nadya Karaban on 04.05.21. -// - -import Foundation -import UIKit -// MARK: - Adds loading indicator to any UIView, configurable with UIActivityIndicatorView.Style, color and scale - -public extension UIView { - func showLoading(style: UIActivityIndicatorView.Style? = .whiteLarge, color: UIColor? = .orange, scale: CGFloat? = 1.0) { - let loading = UIActivityIndicatorView(style: style ?? .whiteLarge) - if let color = color { - loading.color = color - } - loading.contentScaleFactor = scale ?? 1.0 - loading.translatesAutoresizingMaskIntoConstraints = false - loading.startAnimating() - loading.hidesWhenStopped = true - addSubview(loading) - loading.centerYAnchor.constraint(equalTo: centerYAnchor).isActive = true - loading.centerXAnchor.constraint(equalTo: centerXAnchor).isActive = true - } - - func stopLoading() { - removeActivityIndicator() - } - - func removeActivityIndicator() { - let activityIndicators = subviews.filter { $0 is UIActivityIndicatorView } as? [UIActivityIndicatorView] - - activityIndicators?.forEach { activityIndicator in - activityIndicator.stopAnimating() - activityIndicator.removeFromSuperview() - } - } -} diff --git a/BankSDK/GiniBankSDKPinningExample/GiniBankSDKPinningExample.xcodeproj/project.pbxproj b/BankSDK/GiniBankSDKPinningExample/GiniBankSDKPinningExample.xcodeproj/project.pbxproj index d7accd10a0..8a824116a2 100644 --- a/BankSDK/GiniBankSDKPinningExample/GiniBankSDKPinningExample.xcodeproj/project.pbxproj +++ b/BankSDK/GiniBankSDKPinningExample/GiniBankSDKPinningExample.xcodeproj/project.pbxproj @@ -35,7 +35,6 @@ F4807C40263C20BB00F30FF3 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F4807C3F263C20BB00F30FF3 /* Assets.xcassets */; }; F4807C43263C20BB00F30FF3 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F4807C41263C20BB00F30FF3 /* LaunchScreen.storyboard */; }; F4807F342640177600F30FF3 /* PaymentViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4807F332640177500F30FF3 /* PaymentViewModel.swift */; }; - F4807F542641347F00F30FF3 /* UIView+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4807F532641347F00F30FF3 /* UIView+Utils.swift */; }; F4807F7426416A5200F30FF3 /* IBANValidator.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4807F7326416A5200F30FF3 /* IBANValidator.swift */; }; F4807F9026416E2E00F30FF3 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = F4807F9226416E2E00F30FF3 /* Localizable.strings */; }; F4807FB52641713700F30FF3 /* Amount.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4807FB42641713700F30FF3 /* Amount.swift */; }; @@ -113,7 +112,6 @@ F4807C42263C20BB00F30FF3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; F4807C44263C20BB00F30FF3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; F4807F332640177500F30FF3 /* PaymentViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PaymentViewModel.swift; sourceTree = ""; }; - F4807F532641347F00F30FF3 /* UIView+Utils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+Utils.swift"; sourceTree = ""; }; F4807F7326416A5200F30FF3 /* IBANValidator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IBANValidator.swift; sourceTree = ""; }; F4807F9126416E2E00F30FF3 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = ""; }; F4807F9826416E3300F30FF3 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; @@ -252,7 +250,6 @@ F4807F7326416A5200F30FF3 /* IBANValidator.swift */, F4807FC12641830D00F30FF3 /* CredentialsManager.swift */, F4807FB42641713700F30FF3 /* Amount.swift */, - F4807F532641347F00F30FF3 /* UIView+Utils.swift */, ); path = Helpers; sourceTree = ""; @@ -508,7 +505,6 @@ F4807FB52641713700F30FF3 /* Amount.swift in Sources */, F4807FC22641830D00F30FF3 /* CredentialsManager.swift in Sources */, F4807F342640177600F30FF3 /* PaymentViewModel.swift in Sources */, - F4807F542641347F00F30FF3 /* UIView+Utils.swift in Sources */, F4807C37263C20BA00F30FF3 /* AppDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; From 99e67e9e90bf0eaee8ca0f597956d54d9909a2e2 Mon Sep 17 00:00:00 2001 From: Gleb Kulik Date: Tue, 25 Mar 2025 18:16:24 +0100 Subject: [PATCH 006/110] feat(GiniBankAPILibrary): Add GiniUtilites dependency PP-1079 --- BankAPILibrary/GiniBankAPILibrary/Package.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BankAPILibrary/GiniBankAPILibrary/Package.swift b/BankAPILibrary/GiniBankAPILibrary/Package.swift index 716dd3bb0f..61206ed139 100644 --- a/BankAPILibrary/GiniBankAPILibrary/Package.swift +++ b/BankAPILibrary/GiniBankAPILibrary/Package.swift @@ -15,13 +15,14 @@ let package = Package( dependencies: [ // Dependencies declare other packages that this package depends on. // .package(url: /* package url */, from: "1.0.0"), + .package(name: "GiniUtilites", path: "../../GiniComponents/GiniUtilites") ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. // Targets can depend on other targets in this package, and on products in packages this package depends on. .target( name: "GiniBankAPILibrary", - dependencies: []), + dependencies: ["GiniUtilites"]), .testTarget( name: "GiniBankAPILibraryTests", dependencies: ["GiniBankAPILibrary"], From c405aa383e83ef1ea64ff6ced84f6e9f15e07079 Mon Sep 17 00:00:00 2001 From: Gleb Kulik Date: Tue, 25 Mar 2025 18:16:39 +0100 Subject: [PATCH 007/110] feat(GiniCaptureSDK): Add GiniUtilites dependency PP-1079 --- CaptureSDK/GiniCaptureSDK/Package.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CaptureSDK/GiniCaptureSDK/Package.swift b/CaptureSDK/GiniCaptureSDK/Package.swift index 0776c7c3c2..6db4bebce1 100644 --- a/CaptureSDK/GiniCaptureSDK/Package.swift +++ b/CaptureSDK/GiniCaptureSDK/Package.swift @@ -16,7 +16,8 @@ let package = Package( dependencies: [ // Dependencies declare other packages that this package depends on. // .package(url: /* package url */, from: "1.0.0"), - .package(name: "GiniBankAPILibrary", path: "../../BankAPILibrary/GiniBankAPILibrary") + .package(name: "GiniBankAPILibrary", path: "../../BankAPILibrary/GiniBankAPILibrary"), + .package(name: "GiniUtilites", path: "../../GiniComponents/GiniUtilites") ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. @@ -24,8 +25,7 @@ let package = Package( .target( name: "GiniCaptureSDK", - dependencies: ["GiniBankAPILibrary" - ]), + dependencies: ["GiniBankAPILibrary", "GiniUtilites"]), .testTarget( name: "GiniCaptureSDKTests", dependencies: ["GiniCaptureSDK"], From 5ad83c7f7c1ed40e942e1b3cc5b431f24461120b Mon Sep 17 00:00:00 2001 From: Gleb Kulik Date: Wed, 26 Mar 2025 12:21:45 +0100 Subject: [PATCH 008/110] feat(GiniBankSDKExample): remove IBANValidator PP-1079 --- .../project.pbxproj | 4 - .../Helpers/IBANValidator.swift | 98 ------------------- .../PaymentViewController.swift | 1 + 3 files changed, 1 insertion(+), 102 deletions(-) delete mode 100644 BankSDK/GiniBankSDKExample/GiniBankSDKExampleBank/Helpers/IBANValidator.swift diff --git a/BankSDK/GiniBankSDKExample/GiniBankSDKExample.xcodeproj/project.pbxproj b/BankSDK/GiniBankSDKExample/GiniBankSDKExample.xcodeproj/project.pbxproj index 3e1a4034c2..6aa26c7a55 100644 --- a/BankSDK/GiniBankSDKExample/GiniBankSDKExample.xcodeproj/project.pbxproj +++ b/BankSDK/GiniBankSDKExample/GiniBankSDKExample.xcodeproj/project.pbxproj @@ -185,7 +185,6 @@ F4807C40263C20BB00F30FF3 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F4807C3F263C20BB00F30FF3 /* Assets.xcassets */; }; F4807C43263C20BB00F30FF3 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F4807C41263C20BB00F30FF3 /* LaunchScreen.storyboard */; }; F4807F342640177600F30FF3 /* PaymentViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4807F332640177500F30FF3 /* PaymentViewModel.swift */; }; - F4807F7426416A5200F30FF3 /* IBANValidator.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4807F7326416A5200F30FF3 /* IBANValidator.swift */; }; F4807F9026416E2E00F30FF3 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = F4807F9226416E2E00F30FF3 /* Localizable.strings */; }; F4807FB52641713700F30FF3 /* Amount.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4807FB42641713700F30FF3 /* Amount.swift */; }; F4807FC22641830D00F30FF3 /* CredentialsManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4807FC12641830D00F30FF3 /* CredentialsManager.swift */; }; @@ -422,7 +421,6 @@ F4807C42263C20BB00F30FF3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; F4807C44263C20BB00F30FF3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; F4807F332640177500F30FF3 /* PaymentViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PaymentViewModel.swift; sourceTree = ""; }; - F4807F7326416A5200F30FF3 /* IBANValidator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IBANValidator.swift; sourceTree = ""; }; F4807F9126416E2E00F30FF3 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = ""; }; F4807F9826416E3300F30FF3 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; F4807FB42641713700F30FF3 /* Amount.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Amount.swift; sourceTree = ""; }; @@ -1021,7 +1019,6 @@ F4807FBB264182BD00F30FF3 /* Helpers */ = { isa = PBXGroup; children = ( - F4807F7326416A5200F30FF3 /* IBANValidator.swift */, F4807FC12641830D00F30FF3 /* CredentialsManager.swift */, F4807FB42641713700F30FF3 /* Amount.swift */, ); @@ -1427,7 +1424,6 @@ buildActionMask = 2147483647; files = ( F4807C3B263C20BA00F30FF3 /* PaymentViewController.swift in Sources */, - F4807F7426416A5200F30FF3 /* IBANValidator.swift in Sources */, F4807FB52641713700F30FF3 /* Amount.swift in Sources */, F4807FC22641830D00F30FF3 /* CredentialsManager.swift in Sources */, F4807F342640177600F30FF3 /* PaymentViewModel.swift in Sources */, diff --git a/BankSDK/GiniBankSDKExample/GiniBankSDKExampleBank/Helpers/IBANValidator.swift b/BankSDK/GiniBankSDKExample/GiniBankSDKExampleBank/Helpers/IBANValidator.swift deleted file mode 100644 index b03062ef9c..0000000000 --- a/BankSDK/GiniBankSDKExample/GiniBankSDKExampleBank/Helpers/IBANValidator.swift +++ /dev/null @@ -1,98 +0,0 @@ -// -// IBANValidator.swift -// Bank -// -// Created by Nadya Karaban on 04.05.21. -// - -import Foundation -/** - Helper class for IBAN validation. - - */ -final class IBANValidator { - private var countryIbanDictionary: [String: Int] { - return [ - "AL": 28, "AD": 24, "AT": 20, "AZ": 28, "BH": 22, "BE": 16, - "BA": 20, "BR": 29, "BG": 22, "CR": 21, "HR": 21, "CY": 28, - "CZ": 24, "DK": 18, "DO": 28, "EE": 20, "FO": 18, "FI": 18, - "FR": 27, "GE": 22, "DE": 22, "GI": 23, "GB": 22, "GR": 27, - "GL": 18, "GT": 28, "HU": 28, "IS": 26, "IE": 22, "IL": 23, - "IT": 27, "KZ": 20, "KW": 30, "LV": 21, "LB": 28, "LT": 20, - "LU": 20, "MK": 19, "MT": 31, "MR": 27, "MU": 30, "MD": 24, - "MC": 27, "ME": 22, "NL": 18, "NO": 15, "PK": 24, "PS": 29, - "PL": 28, "PT": 25, "RO": 24, "SM": 27, "SA": 24, "RS": 22, - "SK": 24, "SI": 19, "ES": 24, "SE": 24, "TN": 24, "TR": 26, - "AE": 23, "VG": 24, "CH": 21 - ] - } - - private var validationSet: CharacterSet { - return CharacterSet(charactersIn: "01234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ").inverted - } - - func isValid(iban: String) -> Bool { - let iban = iban.replacingOccurrences(of: " ", with: "") - let ibanLength = iban.count - guard let minValues = countryIbanDictionary.values.min(), ibanLength >= minValues else { - return false - } - - if iban.rangeOfCharacter(from: validationSet) != nil { - return false - } - - let countryCode = String(iban[.. UInt32 { - var checkSum = UInt32(0) - var letterNumberMapping: [Character: Int] { - var dict = [Character: Int]() - "ABCDEFGHIJKLMNOPQRSTUVWXYZ".forEach { dict[$0] = Int($0.unicodeScalarCodePoint() - 55) } - return dict - } - - for char in iban { - let value = UInt32(letterNumberMapping[char] ?? Int(String(char)) ?? 0) - if value < 10 { - checkSum = (10 * checkSum) + value - } else { - checkSum = (100 * checkSum) + value - } - if checkSum >= UInt32(UINT32_MAX) / 100 { - checkSum = checkSum % 97 - } - } - return checkSum % 97 - } - - func validateMod97(iban: String) -> Bool { - return checkSum(iban: iban) == 1 - } -} - -extension Character { - func unicodeScalarCodePoint() -> UInt32 { - let scalars = String(self).unicodeScalars - return scalars[scalars.startIndex].value - } -} diff --git a/BankSDK/GiniBankSDKExample/GiniBankSDKExampleBank/PaymentViewController.swift b/BankSDK/GiniBankSDKExample/GiniBankSDKExampleBank/PaymentViewController.swift index 4856b6d7ef..20472512ee 100644 --- a/BankSDK/GiniBankSDKExample/GiniBankSDKExampleBank/PaymentViewController.swift +++ b/BankSDK/GiniBankSDKExample/GiniBankSDKExampleBank/PaymentViewController.swift @@ -9,6 +9,7 @@ import GiniBankAPILibrary import GiniBankSDK import GiniCaptureSDK import UIKit +import GiniUtilites class PaymentViewController: UIViewController { @IBOutlet var receipient: UITextField! From f31fc0bd59a0118d064c489f5c7e80e2d51f5288 Mon Sep 17 00:00:00 2001 From: Gleb Kulik Date: Wed, 26 Mar 2025 12:22:36 +0100 Subject: [PATCH 009/110] feat(GiniBankSDKPinningExample): remove IBANValidator PP-1079 --- .../Helpers/IBANValidator.swift | 98 ------------------- .../project.pbxproj | 4 - 2 files changed, 102 deletions(-) delete mode 100644 BankSDK/GiniBankSDKPinningExample/GiniBankSDKExampleBank/Helpers/IBANValidator.swift diff --git a/BankSDK/GiniBankSDKPinningExample/GiniBankSDKExampleBank/Helpers/IBANValidator.swift b/BankSDK/GiniBankSDKPinningExample/GiniBankSDKExampleBank/Helpers/IBANValidator.swift deleted file mode 100644 index b03062ef9c..0000000000 --- a/BankSDK/GiniBankSDKPinningExample/GiniBankSDKExampleBank/Helpers/IBANValidator.swift +++ /dev/null @@ -1,98 +0,0 @@ -// -// IBANValidator.swift -// Bank -// -// Created by Nadya Karaban on 04.05.21. -// - -import Foundation -/** - Helper class for IBAN validation. - - */ -final class IBANValidator { - private var countryIbanDictionary: [String: Int] { - return [ - "AL": 28, "AD": 24, "AT": 20, "AZ": 28, "BH": 22, "BE": 16, - "BA": 20, "BR": 29, "BG": 22, "CR": 21, "HR": 21, "CY": 28, - "CZ": 24, "DK": 18, "DO": 28, "EE": 20, "FO": 18, "FI": 18, - "FR": 27, "GE": 22, "DE": 22, "GI": 23, "GB": 22, "GR": 27, - "GL": 18, "GT": 28, "HU": 28, "IS": 26, "IE": 22, "IL": 23, - "IT": 27, "KZ": 20, "KW": 30, "LV": 21, "LB": 28, "LT": 20, - "LU": 20, "MK": 19, "MT": 31, "MR": 27, "MU": 30, "MD": 24, - "MC": 27, "ME": 22, "NL": 18, "NO": 15, "PK": 24, "PS": 29, - "PL": 28, "PT": 25, "RO": 24, "SM": 27, "SA": 24, "RS": 22, - "SK": 24, "SI": 19, "ES": 24, "SE": 24, "TN": 24, "TR": 26, - "AE": 23, "VG": 24, "CH": 21 - ] - } - - private var validationSet: CharacterSet { - return CharacterSet(charactersIn: "01234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ").inverted - } - - func isValid(iban: String) -> Bool { - let iban = iban.replacingOccurrences(of: " ", with: "") - let ibanLength = iban.count - guard let minValues = countryIbanDictionary.values.min(), ibanLength >= minValues else { - return false - } - - if iban.rangeOfCharacter(from: validationSet) != nil { - return false - } - - let countryCode = String(iban[.. UInt32 { - var checkSum = UInt32(0) - var letterNumberMapping: [Character: Int] { - var dict = [Character: Int]() - "ABCDEFGHIJKLMNOPQRSTUVWXYZ".forEach { dict[$0] = Int($0.unicodeScalarCodePoint() - 55) } - return dict - } - - for char in iban { - let value = UInt32(letterNumberMapping[char] ?? Int(String(char)) ?? 0) - if value < 10 { - checkSum = (10 * checkSum) + value - } else { - checkSum = (100 * checkSum) + value - } - if checkSum >= UInt32(UINT32_MAX) / 100 { - checkSum = checkSum % 97 - } - } - return checkSum % 97 - } - - func validateMod97(iban: String) -> Bool { - return checkSum(iban: iban) == 1 - } -} - -extension Character { - func unicodeScalarCodePoint() -> UInt32 { - let scalars = String(self).unicodeScalars - return scalars[scalars.startIndex].value - } -} diff --git a/BankSDK/GiniBankSDKPinningExample/GiniBankSDKPinningExample.xcodeproj/project.pbxproj b/BankSDK/GiniBankSDKPinningExample/GiniBankSDKPinningExample.xcodeproj/project.pbxproj index 8a824116a2..2f1dd9efa3 100644 --- a/BankSDK/GiniBankSDKPinningExample/GiniBankSDKPinningExample.xcodeproj/project.pbxproj +++ b/BankSDK/GiniBankSDKPinningExample/GiniBankSDKPinningExample.xcodeproj/project.pbxproj @@ -35,7 +35,6 @@ F4807C40263C20BB00F30FF3 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F4807C3F263C20BB00F30FF3 /* Assets.xcassets */; }; F4807C43263C20BB00F30FF3 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F4807C41263C20BB00F30FF3 /* LaunchScreen.storyboard */; }; F4807F342640177600F30FF3 /* PaymentViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4807F332640177500F30FF3 /* PaymentViewModel.swift */; }; - F4807F7426416A5200F30FF3 /* IBANValidator.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4807F7326416A5200F30FF3 /* IBANValidator.swift */; }; F4807F9026416E2E00F30FF3 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = F4807F9226416E2E00F30FF3 /* Localizable.strings */; }; F4807FB52641713700F30FF3 /* Amount.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4807FB42641713700F30FF3 /* Amount.swift */; }; F4807FC22641830D00F30FF3 /* CredentialsManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4807FC12641830D00F30FF3 /* CredentialsManager.swift */; }; @@ -112,7 +111,6 @@ F4807C42263C20BB00F30FF3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; F4807C44263C20BB00F30FF3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; F4807F332640177500F30FF3 /* PaymentViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PaymentViewModel.swift; sourceTree = ""; }; - F4807F7326416A5200F30FF3 /* IBANValidator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IBANValidator.swift; sourceTree = ""; }; F4807F9126416E2E00F30FF3 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = ""; }; F4807F9826416E3300F30FF3 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; F4807FB42641713700F30FF3 /* Amount.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Amount.swift; sourceTree = ""; }; @@ -247,7 +245,6 @@ F4807FBB264182BD00F30FF3 /* Helpers */ = { isa = PBXGroup; children = ( - F4807F7326416A5200F30FF3 /* IBANValidator.swift */, F4807FC12641830D00F30FF3 /* CredentialsManager.swift */, F4807FB42641713700F30FF3 /* Amount.swift */, ); @@ -501,7 +498,6 @@ buildActionMask = 2147483647; files = ( F4807C3B263C20BA00F30FF3 /* PaymentViewController.swift in Sources */, - F4807F7426416A5200F30FF3 /* IBANValidator.swift in Sources */, F4807FB52641713700F30FF3 /* Amount.swift in Sources */, F4807FC22641830D00F30FF3 /* CredentialsManager.swift in Sources */, F4807F342640177600F30FF3 /* PaymentViewModel.swift in Sources */, From 0791de0c4f53cd96d0e63d6af13f001ae51db298 Mon Sep 17 00:00:00 2001 From: Gleb Kulik Date: Wed, 26 Mar 2025 17:45:20 +0100 Subject: [PATCH 010/110] feat(GiniBankSDK): GiniColorScheme + GiniUtilites PP-1079 --- .../Resources/GiniColorScheme.swift | 250 +++++++++--------- 1 file changed, 125 insertions(+), 125 deletions(-) diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Resources/GiniColorScheme.swift b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Resources/GiniColorScheme.swift index cce990cb09..64da181864 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Resources/GiniColorScheme.swift +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Resources/GiniColorScheme.swift @@ -5,123 +5,123 @@ // import UIKit -import GiniCaptureSDK +import GiniUtilites struct GiniColorScheme { struct Background { - var primary: GiniColor - var secondary: GiniColor + var primary: GiniUtilites.GiniColor + var secondary: GiniUtilites.GiniColor } struct ActionSheet { - var buttonBackground: GiniColor - var cancelButtonBackground: GiniColor + var buttonBackground: GiniUtilites.GiniColor + var cancelButtonBackground: GiniUtilites.GiniColor } struct Alert { - var background: GiniColor - var divider: GiniColor + var background: GiniUtilites.GiniColor + var divider: GiniUtilites.GiniColor } struct NavigationBar { - var background: GiniColor - var action: GiniColor - var navigation: GiniColor + var background: GiniUtilites.GiniColor + var action: GiniUtilites.GiniColor + var navigation: GiniUtilites.GiniColor } struct Content { - var navigation: GiniColor - var text: GiniColor + var navigation: GiniUtilites.GiniColor + var text: GiniUtilites.GiniColor } struct BottomBar { - var background: GiniColor - var border: GiniColor + var background: GiniUtilites.GiniColor + var border: GiniUtilites.GiniColor } struct Container { - var background: GiniColor + var background: GiniUtilites.GiniColor } struct Placeholder { - var background: GiniColor - var tint: GiniColor + var background: GiniUtilites.GiniColor + var tint: GiniUtilites.GiniColor } struct Text { - var primary: GiniColor - var secondary: GiniColor - var tertiary: GiniColor - var accent: GiniColor - var success: GiniColor - var error: GiniColor + var primary: GiniUtilites.GiniColor + var secondary: GiniUtilites.GiniColor + var tertiary: GiniUtilites.GiniColor + var accent: GiniUtilites.GiniColor + var success: GiniUtilites.GiniColor + var error: GiniUtilites.GiniColor } struct Icon { - var primary: GiniColor - var secondary: GiniColor + var primary: GiniUtilites.GiniColor + var secondary: GiniUtilites.GiniColor } struct PageController { - var selected: GiniColor - var unselected: GiniColor + var selected: GiniUtilites.GiniColor + var unselected: GiniUtilites.GiniColor } struct Error { - var background: GiniColor - var icon: GiniColor + var background: GiniUtilites.GiniColor + var icon: GiniUtilites.GiniColor } struct Message { - var backgroundSuccess: GiniColor - var contentSuccess: GiniColor - var backgroundWarning: GiniColor - var contentWarning: GiniColor - var backgroundError: GiniColor - var contentError: GiniColor + var backgroundSuccess: GiniUtilites.GiniColor + var contentSuccess: GiniUtilites.GiniColor + var backgroundWarning: GiniUtilites.GiniColor + var contentWarning: GiniUtilites.GiniColor + var backgroundError: GiniUtilites.GiniColor + var contentError: GiniUtilites.GiniColor } struct Badge { - var background: GiniColor - var content: GiniColor + var background: GiniUtilites.GiniColor + var content: GiniUtilites.GiniColor } struct Button { - var background: GiniColor - var backgroundLoading: GiniColor - var content: GiniColor + var background: GiniUtilites.GiniColor + var backgroundLoading: GiniUtilites.GiniColor + var content: GiniUtilites.GiniColor } struct ButtonOutlined { - var background: GiniColor - var content: GiniColor + var background: GiniUtilites.GiniColor + var content: GiniUtilites.GiniColor } struct TextField { - var background: GiniColor - var border: GiniColor - var focusedText: GiniColor - var unfocusedText: GiniColor - var disabledText: GiniColor - var errorText: GiniColor - var labelFocused: GiniColor - var labelUnfocused: GiniColor - var labelDisabled: GiniColor - var labelError: GiniColor - var supportingFocused: GiniColor - var supportingUnfocused: GiniColor - var supportingDisabled: GiniColor - var supportingError: GiniColor - var trailingFocused: GiniColor - var cursorEnabled: GiniColor - var cursorError: GiniColor + var background: GiniUtilites.GiniColor + var border: GiniUtilites.GiniColor + var focusedText: GiniUtilites.GiniColor + var unfocusedText: GiniUtilites.GiniColor + var disabledText: GiniUtilites.GiniColor + var errorText: GiniUtilites.GiniColor + var labelFocused: GiniUtilites.GiniColor + var labelUnfocused: GiniUtilites.GiniColor + var labelDisabled: GiniUtilites.GiniColor + var labelError: GiniUtilites.GiniColor + var supportingFocused: GiniUtilites.GiniColor + var supportingUnfocused: GiniUtilites.GiniColor + var supportingDisabled: GiniUtilites.GiniColor + var supportingError: GiniUtilites.GiniColor + var trailingFocused: GiniUtilites.GiniColor + var cursorEnabled: GiniUtilites.GiniColor + var cursorError: GiniUtilites.GiniColor } struct Toggle { - var thumb: GiniColor - var trackOn: GiniColor - var trackOff: GiniColor - var disabledTrack: GiniColor + var thumb: GiniUtilites.GiniColor + var trackOn: GiniUtilites.GiniColor + var trackOff: GiniUtilites.GiniColor + var disabledTrack: GiniUtilites.GiniColor } var background: Background @@ -170,153 +170,153 @@ extension UIColor { private static func createBackgroundColorScheme() -> GiniColorScheme.Background { return GiniColorScheme.Background( - primary: GiniColor(light: .GiniBank.light2, dark: .GiniBank.dark2), - secondary: GiniColor(light: .GiniBank.light1, dark: .GiniBank.dark2) + primary: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light2, darkModeColor: .GiniBank.dark2), + secondary: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light1, darkModeColor: .GiniBank.dark2) ) } private static func createActionSheetColorScheme() -> GiniColorScheme.ActionSheet { return GiniColorScheme.ActionSheet( - buttonBackground: GiniColor(light: .GiniBank.light1.withAlphaComponent(0.72), dark: .GiniBank.dark5.withAlphaComponent(0.5)), - cancelButtonBackground: GiniColor(light: .GiniBank.light1, dark: .GiniBank.dark3) + buttonBackground: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light1.withAlphaComponent(0.72), darkModeColor: .GiniBank.dark5.withAlphaComponent(0.5)), + cancelButtonBackground: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light1, darkModeColor: .GiniBank.dark3) ) } private static func createAlertColorScheme() -> GiniColorScheme.Alert { return GiniColorScheme.Alert( - background: GiniColor(light: .GiniBank.light2.withAlphaComponent(0.8), dark: .GiniBank.dark3.withAlphaComponent(0.8)), - divider: GiniColor(light: .GiniBank.light6, dark: .GiniBank.dark4.withAlphaComponent(0.65)) + background: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light2.withAlphaComponent(0.8), darkModeColor: .GiniBank.dark3.withAlphaComponent(0.8)), + divider: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light6, darkModeColor: .GiniBank.dark4.withAlphaComponent(0.65)) ) } private static func createNavigationBarColorScheme() -> GiniColorScheme.NavigationBar { return GiniColorScheme.NavigationBar( - background: GiniColor(light: .GiniBank.light2, dark: .GiniBank.dark2), - action: GiniColor(light: .GiniBank.accent1, dark: .GiniBank.accent1), - navigation: GiniColor(light: .GiniBank.accent1, dark: .GiniBank.accent1) + background: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light2, darkModeColor: .GiniBank.dark2), + action: GiniUtilites.GiniColor(lightModeColor: .GiniBank.accent1, darkModeColor: .GiniBank.accent1), + navigation: GiniUtilites.GiniColor(lightModeColor: .GiniBank.accent1, darkModeColor: .GiniBank.accent1) ) } private static func createContentColorScheme() -> GiniColorScheme.Content { return GiniColorScheme.Content( - navigation: GiniColor(light: .GiniBank.accent1, dark: .GiniBank.accent1), - text: GiniColor(light: .GiniBank.light1, dark: .GiniBank.light1) + navigation: GiniUtilites.GiniColor(lightModeColor: .GiniBank.accent1, darkModeColor: .GiniBank.accent1), + text: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light1, darkModeColor: .GiniBank.light1) ) } private static func createBottomBarColorScheme() -> GiniColorScheme.BottomBar { return GiniColorScheme.BottomBar( - background: GiniColor(light: .GiniBank.light1, dark: .GiniBank.dark3), - border: GiniColor(light: .GiniBank.light3, dark: .GiniBank.dark4) + background: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light1, darkModeColor: .GiniBank.dark3), + border: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light3, darkModeColor: .GiniBank.dark4) ) } private static func createContainerColorScheme() -> GiniColorScheme.Container { return GiniColorScheme.Container( - background: GiniColor(light: .GiniBank.light1, dark: .GiniBank.dark3) + background: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light1, darkModeColor: .GiniBank.dark3) ) } private static func createPlaceholderColorScheme() -> GiniColorScheme.Placeholder { return GiniColorScheme.Placeholder( - background: GiniColor(light: .GiniBank.light2, dark: .GiniBank.dark4), - tint: GiniColor(light: .GiniBank.dark7, dark: .GiniBank.light6) + background: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light2, darkModeColor: .GiniBank.dark4), + tint: GiniUtilites.GiniColor(lightModeColor: .GiniBank.dark7, darkModeColor: .GiniBank.light6) ) } private static func createTextColorScheme() -> GiniColorScheme.Text { return GiniColorScheme.Text( - primary: GiniColor(light: .GiniBank.dark1, dark: .GiniBank.light1), - secondary: GiniColor(light: .GiniBank.dark6, dark: .GiniBank.dark7), - tertiary: GiniColor(light: .GiniBank.dark7, dark: .GiniBank.dark7), - accent: GiniColor(light: .GiniBank.accent1, dark: .GiniBank.accent1), - success: GiniColor(light: .GiniBank.success3, dark: .GiniBank.success3), - error: GiniColor(light: .GiniBank.error3, dark: .GiniBank.error3) + primary: GiniUtilites.GiniColor(lightModeColor: .GiniBank.dark1, darkModeColor: .GiniBank.light1), + secondary: GiniUtilites.GiniColor(lightModeColor: .GiniBank.dark6, darkModeColor: .GiniBank.dark7), + tertiary: GiniUtilites.GiniColor(lightModeColor: .GiniBank.dark7, darkModeColor: .GiniBank.dark7), + accent: GiniUtilites.GiniColor(lightModeColor: .GiniBank.accent1, darkModeColor: .GiniBank.accent1), + success: GiniUtilites.GiniColor(lightModeColor: .GiniBank.success3, darkModeColor: .GiniBank.success3), + error: GiniUtilites.GiniColor(lightModeColor: .GiniBank.error3, darkModeColor: .GiniBank.error3) ) } private static func createIconColorScheme() -> GiniColorScheme.Icon { return GiniColorScheme.Icon( - primary: GiniColor(light: .GiniBank.dark2, dark: .GiniBank.light1), - secondary: GiniColor(light: .GiniBank.light4, dark: .GiniBank.dark6) + primary: GiniUtilites.GiniColor(lightModeColor: .GiniBank.dark2, darkModeColor: .GiniBank.light1), + secondary: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light4, darkModeColor: .GiniBank.dark6) ) } private static func createPageControllerColorScheme() -> GiniColorScheme.PageController { return GiniColorScheme.PageController( - selected: GiniColor(light: .GiniBank.dark1, dark: .GiniBank.light1), - unselected: GiniColor(light: .GiniBank.dark1.withAlphaComponent(0.3), dark: .GiniBank.light1.withAlphaComponent(0.3)) + selected: GiniUtilites.GiniColor(lightModeColor: .GiniBank.dark1, darkModeColor: .GiniBank.light1), + unselected: GiniUtilites.GiniColor(lightModeColor: .GiniBank.dark1.withAlphaComponent(0.3), darkModeColor: .GiniBank.light1.withAlphaComponent(0.3)) ) } private static func createErrorColorScheme() -> GiniColorScheme.Error { return GiniColorScheme.Error( - background: GiniColor(light: .GiniBank.error4, dark: .GiniBank.error4), - icon: GiniColor(light: .GiniBank.error3, dark: .GiniBank.error3) + background: GiniUtilites.GiniColor(lightModeColor: .GiniBank.error4, darkModeColor: .GiniBank.error4), + icon: GiniUtilites.GiniColor(lightModeColor: .GiniBank.error3, darkModeColor: .GiniBank.error3) ) } private static func createMessageColorScheme() -> GiniColorScheme.Message { return GiniColorScheme.Message( - backgroundSuccess: GiniColor(light: .GiniBank.success5, dark: .GiniBank.success5), - contentSuccess: GiniColor(light: .GiniBank.success2, dark: .GiniBank.success2), - backgroundWarning: GiniColor(light: .GiniBank.warning5, dark: .GiniBank.warning5), - contentWarning: GiniColor(light: .GiniBank.warning2, dark: .GiniBank.warning2), - backgroundError: GiniColor(light: .GiniBank.error5, dark: .GiniBank.error5), - contentError: GiniColor(light: .GiniBank.error2, dark: .GiniBank.error2) + backgroundSuccess: GiniUtilites.GiniColor(lightModeColor: .GiniBank.success5, darkModeColor: .GiniBank.success5), + contentSuccess: GiniUtilites.GiniColor(lightModeColor: .GiniBank.success2, darkModeColor: .GiniBank.success2), + backgroundWarning: GiniUtilites.GiniColor(lightModeColor: .GiniBank.warning5, darkModeColor: .GiniBank.warning5), + contentWarning: GiniUtilites.GiniColor(lightModeColor: .GiniBank.warning2, darkModeColor: .GiniBank.warning2), + backgroundError: GiniUtilites.GiniColor(lightModeColor: .GiniBank.error5, darkModeColor: .GiniBank.error5), + contentError: GiniUtilites.GiniColor(lightModeColor: .GiniBank.error2, darkModeColor: .GiniBank.error2) ) } private static func createBadgeColorScheme() -> GiniColorScheme.Badge { return GiniColorScheme.Badge( - background: GiniColor(light: .GiniBank.success3, dark: .GiniBank.success3), - content: GiniColor(light: .GiniBank.light1, dark: .GiniBank.light1) + background: GiniUtilites.GiniColor(lightModeColor: .GiniBank.success3, darkModeColor: .GiniBank.success3), + content: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light1, darkModeColor: .GiniBank.light1) ) } private static func createButtonColorScheme() -> GiniColorScheme.Button { return GiniColorScheme.Button( - background: GiniColor(light: .GiniBank.accent1, dark: .GiniBank.accent1), - backgroundLoading: GiniColor(light: .GiniBank.accent1.withAlphaComponent(0.24), dark: .GiniBank.accent1.withAlphaComponent(0.24)), - content: GiniColor(light: .GiniBank.light1, dark: .GiniBank.light1) + background: GiniUtilites.GiniColor(lightModeColor: .GiniBank.accent1, darkModeColor: .GiniBank.accent1), + backgroundLoading: GiniUtilites.GiniColor(lightModeColor: .GiniBank.accent1.withAlphaComponent(0.24), darkModeColor: .GiniBank.accent1.withAlphaComponent(0.24)), + content: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light1, darkModeColor: .GiniBank.light1) ) } private static func createButtonOutlinedColorScheme() -> GiniColorScheme.ButtonOutlined { return GiniColorScheme.ButtonOutlined( - background: GiniColor(light: .GiniBank.light4, dark: .GiniBank.dark4), - content: GiniColor(light: .GiniBank.dark6, dark: .GiniBank.light6) + background: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light4, darkModeColor: .GiniBank.dark4), + content: GiniUtilites.GiniColor(lightModeColor: .GiniBank.dark6, darkModeColor: .GiniBank.light6) ) } private static func createTextFieldColorScheme() -> GiniColorScheme.TextField { return GiniColorScheme.TextField( - background: GiniColor(light: .GiniBank.light1, dark: .GiniBank.dark3), - border: GiniColor(light: .GiniBank.light3, dark: .GiniBank.dark4), - focusedText: GiniColor(light: .GiniBank.dark2, dark: .GiniBank.light1), - unfocusedText: GiniColor(light: .GiniBank.dark2, dark: .GiniBank.light1), - disabledText: GiniColor(light: .GiniBank.dark2, dark: .GiniBank.light1), - errorText: GiniColor(light: .GiniBank.error3, dark: .GiniBank.error3), - labelFocused: GiniColor(light: .GiniBank.dark6, dark: .GiniBank.dark6), - labelUnfocused: GiniColor(light: .GiniBank.dark6, dark: .GiniBank.dark6), - labelDisabled: GiniColor(light: .GiniBank.dark6, dark: .GiniBank.dark6), - labelError: GiniColor(light: .GiniBank.error3, dark: .GiniBank.error3), - supportingFocused: GiniColor(light: .GiniBank.dark6, dark: .GiniBank.dark6), - supportingUnfocused: GiniColor(light: .GiniBank.dark6, dark: .GiniBank.dark6), - supportingDisabled: GiniColor(light: .GiniBank.dark6, dark: .GiniBank.dark6), - supportingError: GiniColor(light: .GiniBank.error3, dark: .GiniBank.error3), - trailingFocused: GiniColor(light: .GiniBank.dark7, dark: .GiniBank.light6), - cursorEnabled: GiniColor(light: .GiniBank.accent1, dark: .GiniBank.accent1), - cursorError: GiniColor(light: .GiniBank.error3, dark: .GiniBank.error3) + background: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light1, darkModeColor: .GiniBank.dark3), + border: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light3, darkModeColor: .GiniBank.dark4), + focusedText: GiniUtilites.GiniColor(lightModeColor: .GiniBank.dark2, darkModeColor: .GiniBank.light1), + unfocusedText: GiniUtilites.GiniColor(lightModeColor: .GiniBank.dark2, darkModeColor: .GiniBank.light1), + disabledText: GiniUtilites.GiniColor(lightModeColor: .GiniBank.dark2, darkModeColor: .GiniBank.light1), + errorText: GiniUtilites.GiniColor(lightModeColor: .GiniBank.error3, darkModeColor: .GiniBank.error3), + labelFocused: GiniUtilites.GiniColor(lightModeColor: .GiniBank.dark6, darkModeColor: .GiniBank.dark6), + labelUnfocused: GiniUtilites.GiniColor(lightModeColor: .GiniBank.dark6, darkModeColor: .GiniBank.dark6), + labelDisabled: GiniUtilites.GiniColor(lightModeColor: .GiniBank.dark6, darkModeColor: .GiniBank.dark6), + labelError: GiniUtilites.GiniColor(lightModeColor: .GiniBank.error3, darkModeColor: .GiniBank.error3), + supportingFocused: GiniUtilites.GiniColor(lightModeColor: .GiniBank.dark6, darkModeColor: .GiniBank.dark6), + supportingUnfocused: GiniUtilites.GiniColor(lightModeColor: .GiniBank.dark6, darkModeColor: .GiniBank.dark6), + supportingDisabled: GiniUtilites.GiniColor(lightModeColor: .GiniBank.dark6, darkModeColor: .GiniBank.dark6), + supportingError: GiniUtilites.GiniColor(lightModeColor: .GiniBank.error3, darkModeColor: .GiniBank.error3), + trailingFocused: GiniUtilites.GiniColor(lightModeColor: .GiniBank.dark7, darkModeColor: .GiniBank.light6), + cursorEnabled: GiniUtilites.GiniColor(lightModeColor: .GiniBank.accent1, darkModeColor: .GiniBank.accent1), + cursorError: GiniUtilites.GiniColor(lightModeColor: .GiniBank.error3, darkModeColor: .GiniBank.error3) ) } private static func createToggleColorScheme() -> GiniColorScheme.Toggle { return GiniColorScheme.Toggle( - thumb: GiniColor(light: .GiniBank.light1, dark: .GiniBank.light1), - trackOn: GiniColor(light: .GiniBank.accent1, dark: .GiniBank.accent1), - trackOff: GiniColor(light: .GiniBank.light4, dark: .GiniBank.dark4), - disabledTrack: GiniColor(light: .GiniBank.light4, dark: .GiniBank.dark4) + thumb: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light1, darkModeColor: .GiniBank.light1), + trackOn: GiniUtilites.GiniColor(lightModeColor: .GiniBank.accent1, darkModeColor: .GiniBank.accent1), + trackOff: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light4, darkModeColor: .GiniBank.dark4), + disabledTrack: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light4, darkModeColor: .GiniBank.dark4) ) } } From b5084355c378935cd555592e786637a3ed297d68 Mon Sep 17 00:00:00 2001 From: Gleb Kulik Date: Thu, 27 Mar 2025 11:31:27 +0100 Subject: [PATCH 011/110] feat(GiniBankSDK): GiniColorScheme remove prefix after removing CaptureSDK GiniColor conflict PP-1079 --- .../Resources/GiniColorScheme.swift | 248 +++++++++--------- 1 file changed, 124 insertions(+), 124 deletions(-) diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Resources/GiniColorScheme.swift b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Resources/GiniColorScheme.swift index 64da181864..10fb4f38ab 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Resources/GiniColorScheme.swift +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Resources/GiniColorScheme.swift @@ -9,119 +9,119 @@ import GiniUtilites struct GiniColorScheme { struct Background { - var primary: GiniUtilites.GiniColor - var secondary: GiniUtilites.GiniColor + var primary: GiniColor + var secondary: GiniColor } struct ActionSheet { - var buttonBackground: GiniUtilites.GiniColor - var cancelButtonBackground: GiniUtilites.GiniColor + var buttonBackground: GiniColor + var cancelButtonBackground: GiniColor } struct Alert { - var background: GiniUtilites.GiniColor - var divider: GiniUtilites.GiniColor + var background: GiniColor + var divider: GiniColor } struct NavigationBar { - var background: GiniUtilites.GiniColor - var action: GiniUtilites.GiniColor - var navigation: GiniUtilites.GiniColor + var background: GiniColor + var action: GiniColor + var navigation: GiniColor } struct Content { - var navigation: GiniUtilites.GiniColor - var text: GiniUtilites.GiniColor + var navigation: GiniColor + var text: GiniColor } struct BottomBar { - var background: GiniUtilites.GiniColor - var border: GiniUtilites.GiniColor + var background: GiniColor + var border: GiniColor } struct Container { - var background: GiniUtilites.GiniColor + var background: GiniColor } struct Placeholder { - var background: GiniUtilites.GiniColor - var tint: GiniUtilites.GiniColor + var background: GiniColor + var tint: GiniColor } struct Text { - var primary: GiniUtilites.GiniColor - var secondary: GiniUtilites.GiniColor - var tertiary: GiniUtilites.GiniColor - var accent: GiniUtilites.GiniColor - var success: GiniUtilites.GiniColor - var error: GiniUtilites.GiniColor + var primary: GiniColor + var secondary: GiniColor + var tertiary: GiniColor + var accent: GiniColor + var success: GiniColor + var error: GiniColor } struct Icon { - var primary: GiniUtilites.GiniColor - var secondary: GiniUtilites.GiniColor + var primary: GiniColor + var secondary: GiniColor } struct PageController { - var selected: GiniUtilites.GiniColor - var unselected: GiniUtilites.GiniColor + var selected: GiniColor + var unselected: GiniColor } struct Error { - var background: GiniUtilites.GiniColor - var icon: GiniUtilites.GiniColor + var background: GiniColor + var icon: GiniColor } struct Message { - var backgroundSuccess: GiniUtilites.GiniColor - var contentSuccess: GiniUtilites.GiniColor - var backgroundWarning: GiniUtilites.GiniColor - var contentWarning: GiniUtilites.GiniColor - var backgroundError: GiniUtilites.GiniColor - var contentError: GiniUtilites.GiniColor + var backgroundSuccess: GiniColor + var contentSuccess: GiniColor + var backgroundWarning: GiniColor + var contentWarning: GiniColor + var backgroundError: GiniColor + var contentError: GiniColor } struct Badge { - var background: GiniUtilites.GiniColor - var content: GiniUtilites.GiniColor + var background: GiniColor + var content: GiniColor } struct Button { - var background: GiniUtilites.GiniColor - var backgroundLoading: GiniUtilites.GiniColor - var content: GiniUtilites.GiniColor + var background: GiniColor + var backgroundLoading: GiniColor + var content: GiniColor } struct ButtonOutlined { - var background: GiniUtilites.GiniColor - var content: GiniUtilites.GiniColor + var background: GiniColor + var content: GiniColor } struct TextField { - var background: GiniUtilites.GiniColor - var border: GiniUtilites.GiniColor - var focusedText: GiniUtilites.GiniColor - var unfocusedText: GiniUtilites.GiniColor - var disabledText: GiniUtilites.GiniColor - var errorText: GiniUtilites.GiniColor - var labelFocused: GiniUtilites.GiniColor - var labelUnfocused: GiniUtilites.GiniColor - var labelDisabled: GiniUtilites.GiniColor - var labelError: GiniUtilites.GiniColor - var supportingFocused: GiniUtilites.GiniColor - var supportingUnfocused: GiniUtilites.GiniColor - var supportingDisabled: GiniUtilites.GiniColor - var supportingError: GiniUtilites.GiniColor - var trailingFocused: GiniUtilites.GiniColor - var cursorEnabled: GiniUtilites.GiniColor - var cursorError: GiniUtilites.GiniColor + var background: GiniColor + var border: GiniColor + var focusedText: GiniColor + var unfocusedText: GiniColor + var disabledText: GiniColor + var errorText: GiniColor + var labelFocused: GiniColor + var labelUnfocused: GiniColor + var labelDisabled: GiniColor + var labelError: GiniColor + var supportingFocused: GiniColor + var supportingUnfocused: GiniColor + var supportingDisabled: GiniColor + var supportingError: GiniColor + var trailingFocused: GiniColor + var cursorEnabled: GiniColor + var cursorError: GiniColor } struct Toggle { - var thumb: GiniUtilites.GiniColor - var trackOn: GiniUtilites.GiniColor - var trackOff: GiniUtilites.GiniColor - var disabledTrack: GiniUtilites.GiniColor + var thumb: GiniColor + var trackOn: GiniColor + var trackOff: GiniColor + var disabledTrack: GiniColor } var background: Background @@ -170,153 +170,153 @@ extension UIColor { private static func createBackgroundColorScheme() -> GiniColorScheme.Background { return GiniColorScheme.Background( - primary: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light2, darkModeColor: .GiniBank.dark2), - secondary: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light1, darkModeColor: .GiniBank.dark2) + primary: GiniColor(lightModeColor: .GiniBank.light2, darkModeColor: .GiniBank.dark2), + secondary: GiniColor(lightModeColor: .GiniBank.light1, darkModeColor: .GiniBank.dark2) ) } private static func createActionSheetColorScheme() -> GiniColorScheme.ActionSheet { return GiniColorScheme.ActionSheet( - buttonBackground: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light1.withAlphaComponent(0.72), darkModeColor: .GiniBank.dark5.withAlphaComponent(0.5)), - cancelButtonBackground: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light1, darkModeColor: .GiniBank.dark3) + buttonBackground: GiniColor(lightModeColor: .GiniBank.light1.withAlphaComponent(0.72), darkModeColor: .GiniBank.dark5.withAlphaComponent(0.5)), + cancelButtonBackground: GiniColor(lightModeColor: .GiniBank.light1, darkModeColor: .GiniBank.dark3) ) } private static func createAlertColorScheme() -> GiniColorScheme.Alert { return GiniColorScheme.Alert( - background: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light2.withAlphaComponent(0.8), darkModeColor: .GiniBank.dark3.withAlphaComponent(0.8)), - divider: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light6, darkModeColor: .GiniBank.dark4.withAlphaComponent(0.65)) + background: GiniColor(lightModeColor: .GiniBank.light2.withAlphaComponent(0.8), darkModeColor: .GiniBank.dark3.withAlphaComponent(0.8)), + divider: GiniColor(lightModeColor: .GiniBank.light6, darkModeColor: .GiniBank.dark4.withAlphaComponent(0.65)) ) } private static func createNavigationBarColorScheme() -> GiniColorScheme.NavigationBar { return GiniColorScheme.NavigationBar( - background: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light2, darkModeColor: .GiniBank.dark2), - action: GiniUtilites.GiniColor(lightModeColor: .GiniBank.accent1, darkModeColor: .GiniBank.accent1), - navigation: GiniUtilites.GiniColor(lightModeColor: .GiniBank.accent1, darkModeColor: .GiniBank.accent1) + background: GiniColor(lightModeColor: .GiniBank.light2, darkModeColor: .GiniBank.dark2), + action: GiniColor(lightModeColor: .GiniBank.accent1, darkModeColor: .GiniBank.accent1), + navigation: GiniColor(lightModeColor: .GiniBank.accent1, darkModeColor: .GiniBank.accent1) ) } private static func createContentColorScheme() -> GiniColorScheme.Content { return GiniColorScheme.Content( - navigation: GiniUtilites.GiniColor(lightModeColor: .GiniBank.accent1, darkModeColor: .GiniBank.accent1), - text: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light1, darkModeColor: .GiniBank.light1) + navigation: GiniColor(lightModeColor: .GiniBank.accent1, darkModeColor: .GiniBank.accent1), + text: GiniColor(lightModeColor: .GiniBank.light1, darkModeColor: .GiniBank.light1) ) } private static func createBottomBarColorScheme() -> GiniColorScheme.BottomBar { return GiniColorScheme.BottomBar( - background: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light1, darkModeColor: .GiniBank.dark3), - border: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light3, darkModeColor: .GiniBank.dark4) + background: GiniColor(lightModeColor: .GiniBank.light1, darkModeColor: .GiniBank.dark3), + border: GiniColor(lightModeColor: .GiniBank.light3, darkModeColor: .GiniBank.dark4) ) } private static func createContainerColorScheme() -> GiniColorScheme.Container { return GiniColorScheme.Container( - background: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light1, darkModeColor: .GiniBank.dark3) + background: GiniColor(lightModeColor: .GiniBank.light1, darkModeColor: .GiniBank.dark3) ) } private static func createPlaceholderColorScheme() -> GiniColorScheme.Placeholder { return GiniColorScheme.Placeholder( - background: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light2, darkModeColor: .GiniBank.dark4), - tint: GiniUtilites.GiniColor(lightModeColor: .GiniBank.dark7, darkModeColor: .GiniBank.light6) + background: GiniColor(lightModeColor: .GiniBank.light2, darkModeColor: .GiniBank.dark4), + tint: GiniColor(lightModeColor: .GiniBank.dark7, darkModeColor: .GiniBank.light6) ) } private static func createTextColorScheme() -> GiniColorScheme.Text { return GiniColorScheme.Text( - primary: GiniUtilites.GiniColor(lightModeColor: .GiniBank.dark1, darkModeColor: .GiniBank.light1), - secondary: GiniUtilites.GiniColor(lightModeColor: .GiniBank.dark6, darkModeColor: .GiniBank.dark7), - tertiary: GiniUtilites.GiniColor(lightModeColor: .GiniBank.dark7, darkModeColor: .GiniBank.dark7), - accent: GiniUtilites.GiniColor(lightModeColor: .GiniBank.accent1, darkModeColor: .GiniBank.accent1), - success: GiniUtilites.GiniColor(lightModeColor: .GiniBank.success3, darkModeColor: .GiniBank.success3), - error: GiniUtilites.GiniColor(lightModeColor: .GiniBank.error3, darkModeColor: .GiniBank.error3) + primary: GiniColor(lightModeColor: .GiniBank.dark1, darkModeColor: .GiniBank.light1), + secondary: GiniColor(lightModeColor: .GiniBank.dark6, darkModeColor: .GiniBank.dark7), + tertiary: GiniColor(lightModeColor: .GiniBank.dark7, darkModeColor: .GiniBank.dark7), + accent: GiniColor(lightModeColor: .GiniBank.accent1, darkModeColor: .GiniBank.accent1), + success: GiniColor(lightModeColor: .GiniBank.success3, darkModeColor: .GiniBank.success3), + error: GiniColor(lightModeColor: .GiniBank.error3, darkModeColor: .GiniBank.error3) ) } private static func createIconColorScheme() -> GiniColorScheme.Icon { return GiniColorScheme.Icon( - primary: GiniUtilites.GiniColor(lightModeColor: .GiniBank.dark2, darkModeColor: .GiniBank.light1), - secondary: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light4, darkModeColor: .GiniBank.dark6) + primary: GiniColor(lightModeColor: .GiniBank.dark2, darkModeColor: .GiniBank.light1), + secondary: GiniColor(lightModeColor: .GiniBank.light4, darkModeColor: .GiniBank.dark6) ) } private static func createPageControllerColorScheme() -> GiniColorScheme.PageController { return GiniColorScheme.PageController( - selected: GiniUtilites.GiniColor(lightModeColor: .GiniBank.dark1, darkModeColor: .GiniBank.light1), - unselected: GiniUtilites.GiniColor(lightModeColor: .GiniBank.dark1.withAlphaComponent(0.3), darkModeColor: .GiniBank.light1.withAlphaComponent(0.3)) + selected: GiniColor(lightModeColor: .GiniBank.dark1, darkModeColor: .GiniBank.light1), + unselected: GiniColor(lightModeColor: .GiniBank.dark1.withAlphaComponent(0.3), darkModeColor: .GiniBank.light1.withAlphaComponent(0.3)) ) } private static func createErrorColorScheme() -> GiniColorScheme.Error { return GiniColorScheme.Error( - background: GiniUtilites.GiniColor(lightModeColor: .GiniBank.error4, darkModeColor: .GiniBank.error4), - icon: GiniUtilites.GiniColor(lightModeColor: .GiniBank.error3, darkModeColor: .GiniBank.error3) + background: GiniColor(lightModeColor: .GiniBank.error4, darkModeColor: .GiniBank.error4), + icon: GiniColor(lightModeColor: .GiniBank.error3, darkModeColor: .GiniBank.error3) ) } private static func createMessageColorScheme() -> GiniColorScheme.Message { return GiniColorScheme.Message( - backgroundSuccess: GiniUtilites.GiniColor(lightModeColor: .GiniBank.success5, darkModeColor: .GiniBank.success5), - contentSuccess: GiniUtilites.GiniColor(lightModeColor: .GiniBank.success2, darkModeColor: .GiniBank.success2), - backgroundWarning: GiniUtilites.GiniColor(lightModeColor: .GiniBank.warning5, darkModeColor: .GiniBank.warning5), - contentWarning: GiniUtilites.GiniColor(lightModeColor: .GiniBank.warning2, darkModeColor: .GiniBank.warning2), - backgroundError: GiniUtilites.GiniColor(lightModeColor: .GiniBank.error5, darkModeColor: .GiniBank.error5), - contentError: GiniUtilites.GiniColor(lightModeColor: .GiniBank.error2, darkModeColor: .GiniBank.error2) + backgroundSuccess: GiniColor(lightModeColor: .GiniBank.success5, darkModeColor: .GiniBank.success5), + contentSuccess: GiniColor(lightModeColor: .GiniBank.success2, darkModeColor: .GiniBank.success2), + backgroundWarning: GiniColor(lightModeColor: .GiniBank.warning5, darkModeColor: .GiniBank.warning5), + contentWarning: GiniColor(lightModeColor: .GiniBank.warning2, darkModeColor: .GiniBank.warning2), + backgroundError: GiniColor(lightModeColor: .GiniBank.error5, darkModeColor: .GiniBank.error5), + contentError: GiniColor(lightModeColor: .GiniBank.error2, darkModeColor: .GiniBank.error2) ) } private static func createBadgeColorScheme() -> GiniColorScheme.Badge { return GiniColorScheme.Badge( - background: GiniUtilites.GiniColor(lightModeColor: .GiniBank.success3, darkModeColor: .GiniBank.success3), - content: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light1, darkModeColor: .GiniBank.light1) + background: GiniColor(lightModeColor: .GiniBank.success3, darkModeColor: .GiniBank.success3), + content: GiniColor(lightModeColor: .GiniBank.light1, darkModeColor: .GiniBank.light1) ) } private static func createButtonColorScheme() -> GiniColorScheme.Button { return GiniColorScheme.Button( - background: GiniUtilites.GiniColor(lightModeColor: .GiniBank.accent1, darkModeColor: .GiniBank.accent1), - backgroundLoading: GiniUtilites.GiniColor(lightModeColor: .GiniBank.accent1.withAlphaComponent(0.24), darkModeColor: .GiniBank.accent1.withAlphaComponent(0.24)), - content: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light1, darkModeColor: .GiniBank.light1) + background: GiniColor(lightModeColor: .GiniBank.accent1, darkModeColor: .GiniBank.accent1), + backgroundLoading: GiniColor(lightModeColor: .GiniBank.accent1.withAlphaComponent(0.24), darkModeColor: .GiniBank.accent1.withAlphaComponent(0.24)), + content: GiniColor(lightModeColor: .GiniBank.light1, darkModeColor: .GiniBank.light1) ) } private static func createButtonOutlinedColorScheme() -> GiniColorScheme.ButtonOutlined { return GiniColorScheme.ButtonOutlined( - background: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light4, darkModeColor: .GiniBank.dark4), - content: GiniUtilites.GiniColor(lightModeColor: .GiniBank.dark6, darkModeColor: .GiniBank.light6) + background: GiniColor(lightModeColor: .GiniBank.light4, darkModeColor: .GiniBank.dark4), + content: GiniColor(lightModeColor: .GiniBank.dark6, darkModeColor: .GiniBank.light6) ) } private static func createTextFieldColorScheme() -> GiniColorScheme.TextField { return GiniColorScheme.TextField( - background: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light1, darkModeColor: .GiniBank.dark3), - border: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light3, darkModeColor: .GiniBank.dark4), - focusedText: GiniUtilites.GiniColor(lightModeColor: .GiniBank.dark2, darkModeColor: .GiniBank.light1), - unfocusedText: GiniUtilites.GiniColor(lightModeColor: .GiniBank.dark2, darkModeColor: .GiniBank.light1), - disabledText: GiniUtilites.GiniColor(lightModeColor: .GiniBank.dark2, darkModeColor: .GiniBank.light1), - errorText: GiniUtilites.GiniColor(lightModeColor: .GiniBank.error3, darkModeColor: .GiniBank.error3), - labelFocused: GiniUtilites.GiniColor(lightModeColor: .GiniBank.dark6, darkModeColor: .GiniBank.dark6), - labelUnfocused: GiniUtilites.GiniColor(lightModeColor: .GiniBank.dark6, darkModeColor: .GiniBank.dark6), - labelDisabled: GiniUtilites.GiniColor(lightModeColor: .GiniBank.dark6, darkModeColor: .GiniBank.dark6), - labelError: GiniUtilites.GiniColor(lightModeColor: .GiniBank.error3, darkModeColor: .GiniBank.error3), - supportingFocused: GiniUtilites.GiniColor(lightModeColor: .GiniBank.dark6, darkModeColor: .GiniBank.dark6), - supportingUnfocused: GiniUtilites.GiniColor(lightModeColor: .GiniBank.dark6, darkModeColor: .GiniBank.dark6), - supportingDisabled: GiniUtilites.GiniColor(lightModeColor: .GiniBank.dark6, darkModeColor: .GiniBank.dark6), - supportingError: GiniUtilites.GiniColor(lightModeColor: .GiniBank.error3, darkModeColor: .GiniBank.error3), - trailingFocused: GiniUtilites.GiniColor(lightModeColor: .GiniBank.dark7, darkModeColor: .GiniBank.light6), - cursorEnabled: GiniUtilites.GiniColor(lightModeColor: .GiniBank.accent1, darkModeColor: .GiniBank.accent1), - cursorError: GiniUtilites.GiniColor(lightModeColor: .GiniBank.error3, darkModeColor: .GiniBank.error3) + background: GiniColor(lightModeColor: .GiniBank.light1, darkModeColor: .GiniBank.dark3), + border: GiniColor(lightModeColor: .GiniBank.light3, darkModeColor: .GiniBank.dark4), + focusedText: GiniColor(lightModeColor: .GiniBank.dark2, darkModeColor: .GiniBank.light1), + unfocusedText: GiniColor(lightModeColor: .GiniBank.dark2, darkModeColor: .GiniBank.light1), + disabledText: GiniColor(lightModeColor: .GiniBank.dark2, darkModeColor: .GiniBank.light1), + errorText: GiniColor(lightModeColor: .GiniBank.error3, darkModeColor: .GiniBank.error3), + labelFocused: GiniColor(lightModeColor: .GiniBank.dark6, darkModeColor: .GiniBank.dark6), + labelUnfocused: GiniColor(lightModeColor: .GiniBank.dark6, darkModeColor: .GiniBank.dark6), + labelDisabled: GiniColor(lightModeColor: .GiniBank.dark6, darkModeColor: .GiniBank.dark6), + labelError: GiniColor(lightModeColor: .GiniBank.error3, darkModeColor: .GiniBank.error3), + supportingFocused: GiniColor(lightModeColor: .GiniBank.dark6, darkModeColor: .GiniBank.dark6), + supportingUnfocused: GiniColor(lightModeColor: .GiniBank.dark6, darkModeColor: .GiniBank.dark6), + supportingDisabled: GiniColor(lightModeColor: .GiniBank.dark6, darkModeColor: .GiniBank.dark6), + supportingError: GiniColor(lightModeColor: .GiniBank.error3, darkModeColor: .GiniBank.error3), + trailingFocused: GiniColor(lightModeColor: .GiniBank.dark7, darkModeColor: .GiniBank.light6), + cursorEnabled: GiniColor(lightModeColor: .GiniBank.accent1, darkModeColor: .GiniBank.accent1), + cursorError: GiniColor(lightModeColor: .GiniBank.error3, darkModeColor: .GiniBank.error3) ) } private static func createToggleColorScheme() -> GiniColorScheme.Toggle { return GiniColorScheme.Toggle( - thumb: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light1, darkModeColor: .GiniBank.light1), - trackOn: GiniUtilites.GiniColor(lightModeColor: .GiniBank.accent1, darkModeColor: .GiniBank.accent1), - trackOff: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light4, darkModeColor: .GiniBank.dark4), - disabledTrack: GiniUtilites.GiniColor(lightModeColor: .GiniBank.light4, darkModeColor: .GiniBank.dark4) + thumb: GiniColor(lightModeColor: .GiniBank.light1, darkModeColor: .GiniBank.light1), + trackOn: GiniColor(lightModeColor: .GiniBank.accent1, darkModeColor: .GiniBank.accent1), + trackOff: GiniColor(lightModeColor: .GiniBank.light4, darkModeColor: .GiniBank.dark4), + disabledTrack: GiniColor(lightModeColor: .GiniBank.light4, darkModeColor: .GiniBank.dark4) ) } } From 096ece23e921bc1655a7b102ad9f85e6bc5e57e3 Mon Sep 17 00:00:00 2001 From: Gleb Kulik Date: Thu, 27 Mar 2025 14:03:30 +0100 Subject: [PATCH 012/110] feat(GiniCaptureSDK): Camera: fix Logger conflicts PP-1079 --- .../GiniCaptureSDK/Core/Screens/Camera/Camera.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Screens/Camera/Camera.swift b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Screens/Camera/Camera.swift index d7b4722973..62fcc1f4c4 100644 --- a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Screens/Camera/Camera.swift +++ b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Screens/Camera/Camera.swift @@ -149,7 +149,7 @@ final class Camera: NSObject, CameraProtocol { captureDevice.autoFocusRangeRestriction = .near captureDevice.unlockForConfiguration() } catch { - Log(message: "Could not lock device for configuration", event: .error) + GiniCaptureSDK.Log(message: "Could not lock device for configuration", event: .error) return } } @@ -206,7 +206,7 @@ final class Camera: NSObject, CameraProtocol { sessionQueue.async { guard let device = self.videoDeviceInput?.device else { return } guard case .some = try? device.lockForConfiguration() else { - Log(message: "Could not lock device for configuration", event: .error) + GiniCaptureSDK.Log(message: "Could not lock device for configuration", event: .error) return } @@ -373,13 +373,13 @@ fileprivate extension Camera { // Vision recognition handler. func recognizeTextHandler(request: VNRequest, error: Error?) { if let error = error as NSError? { - Log(message: "Error while recognizing IBAN in text due to error \(error.localizedDescription)", + GiniCaptureSDK.Log(message: "Error while recognizing IBAN in text due to error \(error.localizedDescription)", event: .error) return } guard let results = request.results as? [VNRecognizedTextObservation] else { - Log(message: "The observations are of an unexpected type.", + GiniCaptureSDK.Log(message: "The observations are of an unexpected type.", event: .error) return } @@ -485,7 +485,7 @@ extension Camera: AVCaptureVideoDataOutputSampleBufferDelegate { do { try requestHandler.perform([request]) } catch { - Log(message: "Could not perform ocr request due to error \(error.localizedDescription)", + GiniCaptureSDK.Log(message: "Could not perform ocr request due to error \(error.localizedDescription)", event: .error) return } From 51922491b940774977c7ffe7a5d92c231c0949df Mon Sep 17 00:00:00 2001 From: Gleb Kulik Date: Thu, 27 Mar 2025 15:00:28 +0100 Subject: [PATCH 013/110] feat(GiniCaptureSDK): GiniCapture: fix Logger conflicts PP-1079 --- .../Sources/GiniCaptureSDK/Core/GiniCapture.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/GiniCapture.swift b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/GiniCapture.swift index a80fc4b0eb..173c9a0c72 100644 --- a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/GiniCapture.swift +++ b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/GiniCapture.swift @@ -86,7 +86,7 @@ public typealias GiniCaptureNetworkDelegate = AnalysisDelegate & UploadDelegate GiniConfiguration.shared = configuration if configuration.debugModeOn { - Log(message: "DEBUG mode is ON. Never make a release in DEBUG mode!", event: .warning) + GiniCaptureSDK.Log(message: "DEBUG mode is ON. Never make a release in DEBUG mode!", event: .warning) } } From 998ba5fbb869e9b25d2c825e386a744b2ba66d61 Mon Sep 17 00:00:00 2001 From: Gleb Kulik Date: Thu, 27 Mar 2025 15:45:54 +0100 Subject: [PATCH 014/110] feat(GiniCaptureSDK): GiniCaptureUtils: fix Logger conflicts PP-1079 --- .../Sources/GiniCaptureSDK/Core/Helpers/GiniCaptureUtils.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Helpers/GiniCaptureUtils.swift b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Helpers/GiniCaptureUtils.swift index 06ba201893..f4d4ef5cb8 100644 --- a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Helpers/GiniCaptureUtils.swift +++ b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Helpers/GiniCaptureUtils.swift @@ -232,7 +232,7 @@ func measure(block: () -> Void) { let start = Date() block() let elaspsedTime = Date().timeIntervalSince(start) - Log(message: "Elapsed time: \(elaspsedTime) seconds", event: "⏲️") + GiniCaptureSDK.Log(message: "Elapsed time: \(elaspsedTime) seconds", event: "⏲️") } private class CaptureSDKBundleFinder {} From 51dffbfd301984c6135cb674af5e484261a3b1b0 Mon Sep 17 00:00:00 2001 From: Gleb Kulik Date: Thu, 27 Mar 2025 16:11:12 +0100 Subject: [PATCH 015/110] feat(GiniCaptureSDK): GiniScreenAPICoordinator: fix Logger conflicts PP-1079 --- .../Screen API Coordinator/GiniScreenAPICoordinator.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Screens/Screen API Coordinator/GiniScreenAPICoordinator.swift b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Screens/Screen API Coordinator/GiniScreenAPICoordinator.swift index 9b01a095c0..153c46f7ce 100644 --- a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Screens/Screen API Coordinator/GiniScreenAPICoordinator.swift +++ b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Screens/Screen API Coordinator/GiniScreenAPICoordinator.swift @@ -207,7 +207,7 @@ extension GiniScreenAPICoordinator { if let delegate = self.visionDelegate { delegate.didCancelCapturing() } else { - Log(message: "GiniCaptureResultsDelegate is not implemented", event: .error) + GiniCaptureSDK.Log(message: "GiniCaptureResultsDelegate is not implemented", event: .error) } } @@ -215,7 +215,7 @@ extension GiniScreenAPICoordinator { if let delegate = self.visionDelegate { delegate.didPressEnterManually() } else { - Log(message: "GiniCaptureResultsDelegate is not implemented", event: .error) + GiniCaptureSDK.Log(message: "GiniCaptureResultsDelegate is not implemented", event: .error) } } From 347187794a75dddead2941d72c1815917f25010e Mon Sep 17 00:00:00 2001 From: Gleb Kulik Date: Thu, 27 Mar 2025 18:01:18 +0100 Subject: [PATCH 016/110] feat(GiniCaptureSDK): DocumentService: fix Logger conflicts PP-1079 --- .../Networking/DocumentService.swift | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Networking/DocumentService.swift b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Networking/DocumentService.swift index 2265607d20..fd99991556 100644 --- a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Networking/DocumentService.swift +++ b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Networking/DocumentService.swift @@ -148,9 +148,9 @@ public final class DocumentService: DocumentServiceProtocol { } public func sendFeedback(with updatedExtractions: [Extraction], updatedCompoundExtractions: [String: [[Extraction]]]?) { - Log(message: "Sending feedback", event: "💬") + GiniCaptureSDK.Log(message: "Sending feedback", event: "💬") guard let documentId = document?.id else { - Log(message: "Cannot send feedback: no document", event: .error) + GiniCaptureSDK.Log(message: "Cannot send feedback: no document", event: .error) return } attemptFeedback(documentId: documentId, @@ -162,9 +162,9 @@ public final class DocumentService: DocumentServiceProtocol { public func sendSkontoFeedback(with updatedExtractions: [Extraction], updatedCompoundExtractions: [String: [[Extraction]]]?, retryCount: Int) { - Log(message: "Sending feedback", event: "💬") + GiniCaptureSDK.Log(message: "Sending feedback", event: "💬") guard let documentId = document?.id else { - Log(message: "Cannot send feedback: no document", event: .error) + GiniCaptureSDK.Log(message: "Cannot send feedback: no document", event: .error) return } attemptFeedback(documentId: documentId, @@ -184,7 +184,7 @@ public final class DocumentService: DocumentServiceProtocol { switch result { case .success: - Log(message: "Feedback sent with \(updatedExtractions.count) extractions and \(updatedCompoundExtractions?.count ?? 0) compound extractions", + GiniCaptureSDK.Log(message: "Feedback sent with \(updatedExtractions.count) extractions and \(updatedCompoundExtractions?.count ?? 0) compound extractions", event: "🚀") case .failure(let error): self.handleFeedbackFailure(documentId: documentId, @@ -202,7 +202,7 @@ public final class DocumentService: DocumentServiceProtocol { error: Error, retryCount: Int) { if retryCount > 0 { - Log(message: "Retrying feedback due to error: \(error). Remaining retries: \(retryCount - 1)", event: .warning) + GiniCaptureSDK.Log(message: "Retrying feedback due to error: \(error). Remaining retries: \(retryCount - 1)", event: .warning) DispatchQueue.global().asyncAfter(deadline: .now() + 5) { [weak self] in self?.attemptFeedback(documentId: documentId, updatedExtractions: updatedExtractions, @@ -216,7 +216,7 @@ public final class DocumentService: DocumentServiceProtocol { private func handleFeedbackError(documentId: String, error: Error) { let message = "Error sending feedback for document with id: \(documentId) error: \(error)" - Log(message: message, event: .error) + GiniCaptureSDK.Log(message: message, event: .error) let errorLog = ErrorLog(description: message, error: error) GiniConfiguration.shared.errorLogger.handleErrorLog(error: errorLog) } @@ -232,10 +232,10 @@ public final class DocumentService: DocumentServiceProtocol { captureNetworkService.log(errorEvent: errorEvent) { result in switch result { case .success: - Log(message: "Error event sent to Gini", event: .success) + GiniCaptureSDK.Log(message: "Error event sent to Gini", event: .success) break case .failure(let error): - Log(message: "Failed to send error event to Gini: \(error)", event: .error) + GiniCaptureSDK.Log(message: "Failed to send error event to Gini: \(error)", event: .error) break } } @@ -243,7 +243,7 @@ public final class DocumentService: DocumentServiceProtocol { public func layout(completion: @escaping DocumentLayoutCompletion) { guard let document = document else { - Log(message: "Cannot get document layout: no document", event: .error) + GiniCaptureSDK.Log(message: "Cannot get document layout: no document", event: .error) return } captureNetworkService.layout(for: document) { result in @@ -252,7 +252,7 @@ public final class DocumentService: DocumentServiceProtocol { completion(.success(documentLayout)) case .failure(let error): let message = "Failed to get layout for document with id: \(document.id) error: \(error)" - Log(message: message, event: .error) + GiniCaptureSDK.Log(message: message, event: .error) completion(.failure(error)) } } @@ -260,7 +260,7 @@ public final class DocumentService: DocumentServiceProtocol { public func pages(completion: @escaping DocumentPagsCompletion) { guard let document = document else { - Log(message: "Cannot get document pages", event: .error) + GiniCaptureSDK.Log(message: "Cannot get document pages", event: .error) return } captureNetworkService.pages(for: document) { result in @@ -269,7 +269,7 @@ public final class DocumentService: DocumentServiceProtocol { completion(.success(pages)) case let .failure(error): let message = "Failed to get pages for document with id: \(document.id) error: \(error)" - Log(message: message, event: .error) + GiniCaptureSDK.Log(message: message, event: .error) completion(.failure(error)) } } @@ -279,7 +279,7 @@ public final class DocumentService: DocumentServiceProtocol { size: Document.Page.Size, completion: @escaping DocumentPagePreviewCompletion){ guard let document = document else { - Log(message: "Cannot get document page", event: .error) + GiniCaptureSDK.Log(message: "Cannot get document page", event: .error) return } captureNetworkService.documentPage(for: document, @@ -290,7 +290,7 @@ public final class DocumentService: DocumentServiceProtocol { completion(.success(pageData)) case .failure(let error): let message = "Failed to get page for document with id: \(document.id) error: \(error)" - Log(message: message, event: .error) + GiniCaptureSDK.Log(message: message, event: .error) completion(.failure(error)) } } From ec8a9ebb94ca7d15c80da7f749dc3b1536f595db Mon Sep 17 00:00:00 2001 From: Gleb Kulik Date: Thu, 27 Mar 2025 19:09:12 +0100 Subject: [PATCH 017/110] feat(GiniCaptureSDK): GiniErrorLogger: fix Logger conflicts PP-1079 --- .../Sources/GiniCaptureSDK/Networking/GiniErrorLogger.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Networking/GiniErrorLogger.swift b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Networking/GiniErrorLogger.swift index 94b9800737..3196c70e4d 100644 --- a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Networking/GiniErrorLogger.swift +++ b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Networking/GiniErrorLogger.swift @@ -17,7 +17,7 @@ class GiniErrorLogger: GiniCaptureErrorLoggerDelegate { } public func handleErrorLog(error: ErrorLog) { - Log(message: "Sending error log to Gini: \(error)", event: "📝") + GiniCaptureSDK.Log(message: "Sending error log to Gini: \(error)", event: "📝") documentService.log(errorEvent: ErrorEvent.from(error)) } } From 16aab0a0739fd09a325d41f5fa6837d5ad529e0b Mon Sep 17 00:00:00 2001 From: Gleb Kulik Date: Fri, 28 Mar 2025 07:49:05 +0100 Subject: [PATCH 018/110] feat(GiniCaptureSDK): Use IbanValidator from GiniUtilites PP-1079 --- .../GiniCaptureDocumentValidator.swift | 1 + .../Core/Helpers/QRCodesExtractor.swift | 1 + .../Core/Models/GiniQRCodeDocument.swift | 1 + .../Screens/Camera/IBAN/IBANRecogniser.swift | 1 + .../Screens/Camera/IBAN/IBANValidator.swift | 81 ------------------- 5 files changed, 4 insertions(+), 81 deletions(-) delete mode 100644 CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Screens/Camera/IBAN/IBANValidator.swift diff --git a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Helpers/GiniCaptureDocumentValidator.swift b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Helpers/GiniCaptureDocumentValidator.swift index 7c1e7bc653..eb87685254 100644 --- a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Helpers/GiniCaptureDocumentValidator.swift +++ b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Helpers/GiniCaptureDocumentValidator.swift @@ -7,6 +7,7 @@ import Foundation import CoreGraphics +import GiniUtilites public final class GiniCaptureDocumentValidator { diff --git a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Helpers/QRCodesExtractor.swift b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Helpers/QRCodesExtractor.swift index 81d444d496..0cd8d4ab65 100644 --- a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Helpers/QRCodesExtractor.swift +++ b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Helpers/QRCodesExtractor.swift @@ -6,6 +6,7 @@ // import Foundation +import GiniUtilites public enum QRCodesFormat { case epc06912 diff --git a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Models/GiniQRCodeDocument.swift b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Models/GiniQRCodeDocument.swift index 54d6d62d62..1144ec2924 100644 --- a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Models/GiniQRCodeDocument.swift +++ b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Models/GiniQRCodeDocument.swift @@ -7,6 +7,7 @@ import GiniBankAPILibrary import UIKit +import GiniUtilites /** A Gini Capture document made from a QR code. diff --git a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Screens/Camera/IBAN/IBANRecogniser.swift b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Screens/Camera/IBAN/IBANRecogniser.swift index b4b4d4c56c..868d84fe4c 100644 --- a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Screens/Camera/IBAN/IBANRecogniser.swift +++ b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Screens/Camera/IBAN/IBANRecogniser.swift @@ -5,6 +5,7 @@ // import Foundation +import GiniUtilites func extractIBANS(string: String) -> [String] { var results = [String]() diff --git a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Screens/Camera/IBAN/IBANValidator.swift b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Screens/Camera/IBAN/IBANValidator.swift deleted file mode 100644 index b8a1e88e78..0000000000 --- a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Screens/Camera/IBAN/IBANValidator.swift +++ /dev/null @@ -1,81 +0,0 @@ -// -// IBANValidator.swift -// GiniCaptureSDK -// -// Copyright © 2023 Gini GmbH. All rights reserved. -// - -import Foundation - -final class IBANValidator { - - private var validationSet: CharacterSet { - return CharacterSet(charactersIn: "01234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ").inverted - } - private let countryIbanDictionary: [String: Int] = IBANKnowledge().countryIbanDictionary - - func isValid(iban: String) -> Bool { - let iban = iban.replacingOccurrences(of: " ", with: "") - let ibanLength = iban.count - guard let minValues = countryIbanDictionary.values.min(), ibanLength >= minValues else { - return false - } - - if iban.rangeOfCharacter(from: validationSet) != nil { - return false - } - - let countryCode = String(iban[.. UInt32 { - var checkSum = UInt32(0) - var letterNumberMapping: [Character: Int] { - var dict = [Character: Int]() - "ABCDEFGHIJKLMNOPQRSTUVWXYZ".forEach { dict[$0] = Int($0.unicodeScalarCodePoint() - 55) } - return dict - } - - for char in iban { - let value = UInt32(letterNumberMapping[char] ?? Int(String(char)) ?? 0) - if value < 10 { - checkSum = (10 * checkSum) + value - } else { - checkSum = (100 * checkSum) + value - } - if checkSum >= UInt32(UINT32_MAX) / 100 { - checkSum = checkSum % 97 - } - } - return checkSum % 97 - } - - func validateMod97(iban: String) -> Bool { - return checkSum(iban: iban) == 1 - } -} - -extension Character { - func unicodeScalarCodePoint() -> UInt32 { - let scalars = String(self).unicodeScalars - return scalars[scalars.startIndex].value - } -} From 4e0e82651dfc1d59743e8fa4965c35f750d8e452 Mon Sep 17 00:00:00 2001 From: Gleb Kulik Date: Fri, 28 Mar 2025 10:34:01 +0100 Subject: [PATCH 019/110] feat(GiniBankSDK): remove deprecated cleanup method from GiniBankConfiguration PP-1065 --- .../Core/GiniBankConfiguration.swift | 70 ------------------- 1 file changed, 70 deletions(-) diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/GiniBankConfiguration.swift b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/GiniBankConfiguration.swift index c89a007772..394b58b2c5 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/GiniBankConfiguration.swift +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/GiniBankConfiguration.swift @@ -529,76 +529,6 @@ public final class GiniBankConfiguration: NSObject { // MARK: - Transfer summary sending and cleanup - // swiftlint:disable function_parameter_count - /// Function for clean up - /// - Parameters: - /// - paymentRecipient: paymentRecipient description - /// - paymentReference: paymentReference description - /// - iban: iban description - /// - bic: bic description - /// - amountToPay: amountToPay description - // swiftlint:disable line_length - @available(*, deprecated, message: "Please use sendTransferSummary() to provide the required transfer summary first (if the user has completed TAN verification) and then cleanup() to let the SDK free up used resources") - // swiftlint:enable line_length - // swiftlint:disable function_body_length - public func cleanup(paymentRecipient: String, - paymentReference: String, - paymentPurpose: String, - iban: String, - bic: String, - amountToPay: ExtractionAmount) { - guard let documentService = documentService else { return } - - let paymentRecipientExtraction = Extraction(box: nil, - candidates: nil, - entity: "companyname", - value: paymentRecipient, - name: "paymentRecipient") - let paymentReferenceExtraction = Extraction(box: nil, - candidates: nil, - entity: "reference", - value: paymentReference, - name: "paymentReference") - let paymentPurposeExtraction = Extraction(box: nil, - candidates: nil, - entity: "text", - value: paymentPurpose, - name: "paymentPurpose") - let ibanExtraction = Extraction(box: nil, - candidates: nil, - entity: "iban", - value: iban, - name: "iban") - let bicExtraction = Extraction(box: nil, - candidates: nil, - entity: "bic", - value: bic, - name: "bic") - let amountExtraction = Extraction(box: nil, - candidates: nil, - entity: "amount", - value: amountToPay.formattedString(), - name: "amountToPay") - - let updatedExtractions: [Extraction] = [paymentRecipientExtraction, - paymentReferenceExtraction, - paymentPurposeExtraction, - ibanExtraction, - bicExtraction, - amountExtraction] - - if let lineItems = lineItems { - documentService.sendFeedback(with: updatedExtractions, - updatedCompoundExtractions: ["lineItems": lineItems]) - } else { - documentService.sendFeedback(with: updatedExtractions, - updatedCompoundExtractions: nil) - } - - documentService.resetToInitialState() - self.documentService = nil - self.lineItems = nil - } // swiftlint:enable function_body_length // swiftlint:enable function_parameter_count /** From 897b2423267310916662d027cd300f4d207359ce Mon Sep 17 00:00:00 2001 From: Gleb Kulik Date: Fri, 28 Mar 2025 10:34:34 +0100 Subject: [PATCH 020/110] feat(GiniCaptureSDK): remove deprecated cleanup method from GiniConfiguration PP-1065 --- .../Core/GiniConfiguration.swift | 32 ------------------- 1 file changed, 32 deletions(-) diff --git a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/GiniConfiguration.swift b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/GiniConfiguration.swift index 3aa247655d..f87560d3e2 100644 --- a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/GiniConfiguration.swift +++ b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/GiniConfiguration.swift @@ -464,38 +464,6 @@ import GiniBankAPILibrary var documentService: DocumentServiceProtocol? - // swiftlint:disable function_parameter_count - /// Function for clean up - /// - Parameters: - /// - paymentRecipient: paymentRecipient description - /// - paymentReference: paymentReference description - /// - iban: iban description - /// - bic: bic description - /// - amountToPay: amountToPay description - // swiftlint:disable line_length - @available(*, deprecated, message: "Please use sendTransferSummary() to provide the required transfer summary first (if the user has completed TAN verification) and then cleanup() to let the SDK free up used resources") - // swiftlint:enable line_length - public func cleanup(paymentRecipient: String, - paymentReference: String, - paymentPurpose: String, - iban: String, - bic: String, - amountToPay: ExtractionAmount) { - guard let documentService = documentService else { return } - - let updatedExtractions = buildPaymentExtractions(paymentRecipient, - paymentReference, - paymentPurpose, - iban, - bic, - amountToPay) - - documentService.sendFeedback(with: updatedExtractions, updatedCompoundExtractions: nil) - - documentService.resetToInitialState() - self.documentService = nil - } - private func buildPaymentExtractions(_ paymentRecipient: String, _ paymentReference: String, _ paymentPurpose: String, From 431c327c8cb2123edf4b194dab7f3c7cfbcf7648 Mon Sep 17 00:00:00 2001 From: Gleb Kulik Date: Fri, 28 Mar 2025 12:07:19 +0100 Subject: [PATCH 021/110] feat(GiniBankAPILibrary): SessionManager: fix Logger conflicts PP-1079 --- .../GiniBankAPILibrary/Documents/Core/SessionManager.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BankAPILibrary/GiniBankAPILibrary/Sources/GiniBankAPILibrary/Documents/Core/SessionManager.swift b/BankAPILibrary/GiniBankAPILibrary/Sources/GiniBankAPILibrary/Documents/Core/SessionManager.swift index aa06bdb2c6..d420426cc4 100644 --- a/BankAPILibrary/GiniBankAPILibrary/Sources/GiniBankAPILibrary/Documents/Core/SessionManager.swift +++ b/BankAPILibrary/GiniBankAPILibrary/Sources/GiniBankAPILibrary/Documents/Core/SessionManager.swift @@ -153,7 +153,7 @@ private extension SessionManager { cancellationToken: cancellationToken, completion: completion).resume() } else { - Log("Stored token is no longer valid", event: .warning) + GiniBankAPILibrary.Log("Stored token is no longer valid", event: .warning) handleLoginFlow(resource: resource, taskType: taskType, cancellationToken: cancellationToken, @@ -267,10 +267,10 @@ private extension SessionManager { completion: @escaping CompletionResult) { do { let result = try resource.parsed(response: response, data: data) - Log("Success: \(request.httpMethod!) - \(request.url!)", event: .success) + GiniBankAPILibrary.Log("Success: \(request.httpMethod!) - \(request.url!)", event: .success) completion(.success(result)) } catch let error { - Log(""" + GiniBankAPILibrary.Log(""" Failure: \(request.httpMethod!) - \(request.url!) Parse error: \(error) Data content: \(String(data: data, encoding: .utf8) ?? "nil") From 32dc30f700bf54d9011e98ce1c199dfa86c9a541 Mon Sep 17 00:00:00 2001 From: Gleb Kulik Date: Fri, 28 Mar 2025 13:24:04 +0100 Subject: [PATCH 022/110] feat(GiniCaptureSDK): DefaultCaptureNetworkService: fix Logger conflicts PP-1079 --- .../GiniCaptureNetworkService.swift | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Networking/GiniCaptureNetworkService.swift b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Networking/GiniCaptureNetworkService.swift index 590b0805bf..ca94940b3c 100644 --- a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Networking/GiniCaptureNetworkService.swift +++ b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Networking/GiniCaptureNetworkService.swift @@ -111,8 +111,8 @@ class DefaultCaptureNetworkService: GiniCaptureNetworkService { switch result { case .success(let result): completion(.success(result)) - Log(message: "Deleted \(document.sourceClassification.rawValue) document with id: \(document.id)", - event: "🗑") + GiniCaptureSDK.Log(message: "Deleted \(document.sourceClassification.rawValue) document with id: \(document.id)", + event: "🗑") case .failure(let error): let message = "Error deleting \(document.sourceClassification.rawValue) document with" + " id: \(document.id)" @@ -128,7 +128,7 @@ class DefaultCaptureNetworkService: GiniCaptureNetworkService { metadata: Document.Metadata?, cancellationToken: CancellationToken, completion: @escaping (Result<(document: Document, extractionResult: ExtractionResult), GiniError>) -> Void) { - Log(message: "Creating composite document...", event: "📑") + GiniCaptureSDK.Log(message: "Creating composite document...", event: "📑") let fileName = "Composite-\(NSDate().timeIntervalSince1970)" documentService @@ -139,11 +139,11 @@ class DefaultCaptureNetworkService: GiniCaptureNetworkService { guard let self = self else { return } switch result { case let .success(createdDocument): - Log(message: "Starting analysis for composite document \(createdDocument.id)", - event: "🔎") - self.startExtraction(for: createdDocument, - cancellationToken: cancellationToken, - completion: completion) + GiniCaptureSDK.Log(message: "Starting analysis for composite document \(createdDocument.id)", + event: "🔎") + self.startExtraction(for: createdDocument, + cancellationToken: cancellationToken, + completion: completion) case let .failure(error): self.logError(message: "Composite document creation failed with error: \(error)", error: error) @@ -165,7 +165,7 @@ class DefaultCaptureNetworkService: GiniCaptureNetworkService { metadata.addUploadMetadata(uploadMetadata) return metadata }() - Log(message: "Creating document...", event: "📝") + GiniCaptureSDK.Log(message: "Creating document...", event: "📝") let fileName = "Partial-\(NSDate().timeIntervalSince1970)" @@ -175,7 +175,7 @@ class DefaultCaptureNetworkService: GiniCaptureNetworkService { metadata: documentMetadata) { result in switch result { case let .success(createdDocument): - Log(message: "Created document with id: \(createdDocument.id) " + + GiniCaptureSDK.Log(message: "Created document with id: \(createdDocument.id) " + "for vision document \(document.id)", event: "📄") completion(.success(createdDocument)) case let .failure(error): @@ -218,7 +218,7 @@ class DefaultCaptureNetworkService: GiniCaptureNetworkService { } func layout(for document: Document, completion: @escaping DocumentLayoutCompletion) { - Log(message: "Getting layout for document with id: \(document.id) ", event: "📝") + GiniCaptureSDK.Log(message: "Getting layout for document with id: \(document.id) ", event: "📝") documentService.layout(for: document) { result in switch result { case let .success(layout): @@ -232,7 +232,7 @@ class DefaultCaptureNetworkService: GiniCaptureNetworkService { } func pages(for document: Document, completion: @escaping (Result<[Document.Page], GiniError>) -> Void) { - Log(message: "Getting pages for document with id: \(document.id) ", event: "📝") + GiniCaptureSDK.Log(message: "Getting pages for document with id: \(document.id) ", event: "📝") documentService.pages(in: document) { result in switch result { case let .success(pages): @@ -249,7 +249,7 @@ class DefaultCaptureNetworkService: GiniCaptureNetworkService { pageNumber: Int, size: GiniBankAPILibrary.Document.Page.Size, completion: @escaping DocumentPagePreviewCompletion) { - Log(message: "Getting page for document with id: \(document.id) ", event: "📝") + GiniCaptureSDK.Log(message: "Getting page for document with id: \(document.id) ", event: "📝") documentService.documentPage(for: document, pageNumber: pageNumber, size: size) { result in @@ -275,13 +275,13 @@ class DefaultCaptureNetworkService: GiniCaptureNetworkService { cancellationToken: cancellationToken) { result in switch result { case let .success(extractionResult): - Log(message: "Finished analysis process with no errors", event: .success) + GiniCaptureSDK.Log(message: "Finished analysis process with no errors", event: .success) completion(.success((document, extractionResult))) case let .failure(error): if error == .requestCancelled { - Log(message: "Cancelled analysis process", event: .error) + GiniCaptureSDK.Log(message: "Cancelled analysis process", event: .error) } else { - Log(message: "Finished analysis process with error: \(error)", event: .error) + GiniCaptureSDK.Log(message: "Finished analysis process with error: \(error)", event: .error) } completion(.failure(error)) } @@ -289,7 +289,7 @@ class DefaultCaptureNetworkService: GiniCaptureNetworkService { } private func logError(message: String, error: GiniError) { - Log(message: message, event: .error) + GiniCaptureSDK.Log(message: message, event: .error) let errorLog = ErrorLog(description: message, error: error) GiniConfiguration.shared.errorLogger.handleErrorLog(error: errorLog) } From f17d318aca1de2a1129de0eef6bd974b048e3273 Mon Sep 17 00:00:00 2001 From: Gleb Kulik Date: Tue, 1 Apr 2025 14:58:24 +0200 Subject: [PATCH 023/110] feat(GiniBankSDK): GiniColorScheme move in GiniUtilites. giniColorScheme() -> giniBankColorScheme() in GiniBankSDK PP-1081 --- .../DigitalInvoiceBottomNavigationBar.swift | 14 +- .../DigitalInvoiceProceedView.swift | 14 +- .../DigitalInvoiceSkontoTableViewCell.swift | 8 +- .../DigitalInvoiceSkontoViewController.swift | 4 +- .../DefaultSkontoBottomNavigationBar.swift | 14 +- .../Help/SkontoHelpViewController.swift | 2 +- .../Help/Views/SkontoHelpFooterView.swift | 2 +- .../Help/Views/SkontoHelpHeaderView.swift | 4 +- .../Help/Views/SkontoHelpItemView.swift | 4 +- .../Views/SkontoHelpItemsContainerView.swift | 2 +- .../Core/Skonto/SkontoViewController.swift | 6 +- .../Skonto/Views/SkontoAmountToPayView.swift | 12 +- .../Views/SkontoDocumentPreviewView.swift | 10 +- .../Skonto/Views/SkontoExpiryDateView.swift | 10 +- .../Skonto/Views/SkontoInfoBannerView.swift | 14 +- .../Views/SkontoProceedContainerView.swift | 14 +- .../Views/SkontoWithDiscountHeaderView.swift | 8 +- .../Views/SkontoWithoutDiscountView.swift | 6 +- .../TransactionDocsHeaderView.swift | 2 +- .../Components/TransactionDocsItemView.swift | 8 +- ...Scheme.swift => GiniBankColorScheme.swift} | 139 +-------- .../GiniUtilites/Color/GiniColorScheme.swift | 281 ++++++++++++++++++ 22 files changed, 361 insertions(+), 217 deletions(-) rename BankSDK/GiniBankSDK/Sources/GiniBankSDK/Resources/{GiniColorScheme.swift => GiniBankColorScheme.swift} (75%) create mode 100644 GiniComponents/GiniUtilites/Sources/GiniUtilites/Color/GiniColorScheme.swift diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/ReturnAssistant/DigitalInvoice/Bottom navigation/DigitalInvoiceBottomNavigationBar.swift b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/ReturnAssistant/DigitalInvoice/Bottom navigation/DigitalInvoiceBottomNavigationBar.swift index 7b9876508d..460b070dbf 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/ReturnAssistant/DigitalInvoice/Bottom navigation/DigitalInvoiceBottomNavigationBar.swift +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/ReturnAssistant/DigitalInvoice/Bottom navigation/DigitalInvoiceBottomNavigationBar.swift @@ -45,7 +45,7 @@ final class DigitalInvoiceBottomNavigationBar: UIView { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false label.font = configuration.textStyleFonts[.subheadline] - label.textColor = .giniColorScheme().text.primary.uiColor() + label.textColor = .giniBankColorScheme().text.primary.uiColor() label.adjustsFontForContentSizeCategory = true let text = NSLocalizedStringPreferredGiniBankFormat("ginibank.digitalinvoice.lineitem.totalpricetitle", comment: "Total") @@ -58,7 +58,7 @@ final class DigitalInvoiceBottomNavigationBar: UIView { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false label.font = configuration.textStyleFonts[.title2Bold] - label.textColor = .giniColorScheme().text.primary.uiColor() + label.textColor = .giniBankColorScheme().text.primary.uiColor() label.adjustsFontForContentSizeCategory = true label.adjustsFontSizeToFitWidth = true label.setContentHuggingPriority(.defaultHigh, for: .horizontal) @@ -70,7 +70,7 @@ final class DigitalInvoiceBottomNavigationBar: UIView { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false label.font = configuration.textStyleFonts[.footnoteBold] - label.textColor = .giniColorScheme().badge.content.uiColor() + label.textColor = .giniBankColorScheme().badge.content.uiColor() label.adjustsFontForContentSizeCategory = true label.adjustsFontSizeToFitWidth = true label.setContentHuggingPriority(.defaultLow, for: .horizontal) @@ -80,7 +80,7 @@ final class DigitalInvoiceBottomNavigationBar: UIView { private lazy var skontoBadgeView: UIView = { let view = UIView() - view.backgroundColor = .giniColorScheme().badge.background.uiColor() + view.backgroundColor = .giniBankColorScheme().badge.background.uiColor() view.layer.cornerRadius = Constants.cornerRadius view.layer.masksToBounds = true view.isHidden = true @@ -93,7 +93,7 @@ final class DigitalInvoiceBottomNavigationBar: UIView { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false label.font = configuration.textStyleFonts[.footnoteBold] - label.textColor = .giniColorScheme().text.success.uiColor() + label.textColor = .giniBankColorScheme().text.success.uiColor() label.adjustsFontForContentSizeCategory = true label.adjustsFontSizeToFitWidth = true return label @@ -101,7 +101,7 @@ final class DigitalInvoiceBottomNavigationBar: UIView { private lazy var dividerView: UIView = { let dividerView = UIView() - dividerView.backgroundColor = .giniColorScheme().bottomBar.border.uiColor() + dividerView.backgroundColor = .giniBankColorScheme().bottomBar.border.uiColor() dividerView.translatesAutoresizingMaskIntoConstraints = false return dividerView }() @@ -156,7 +156,7 @@ final class DigitalInvoiceBottomNavigationBar: UIView { } private func setupView() { - backgroundColor = .giniColorScheme().background.secondary.uiColor() + backgroundColor = .giniBankColorScheme().background.secondary.uiColor() addSubview(contentView) addSubview(dividerView) diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/ReturnAssistant/DigitalInvoice/Components/DigitalInvoiceProceedView.swift b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/ReturnAssistant/DigitalInvoice/Components/DigitalInvoiceProceedView.swift index 3ef76177a3..7dfcea7f35 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/ReturnAssistant/DigitalInvoice/Components/DigitalInvoiceProceedView.swift +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/ReturnAssistant/DigitalInvoice/Components/DigitalInvoiceProceedView.swift @@ -33,7 +33,7 @@ class DigitalInvoiceProceedView: UIView { label.translatesAutoresizingMaskIntoConstraints = false label.adjustsFontForContentSizeCategory = true label.font = configuration.textStyleFonts[.subheadline] - label.textColor = .giniColorScheme().text.primary.uiColor() + label.textColor = .giniBankColorScheme().text.primary.uiColor() let labelText = NSLocalizedStringPreferredGiniBankFormat("ginibank.digitalinvoice.lineitem.totalpricetitle", comment: "Total") label.text = labelText @@ -45,7 +45,7 @@ class DigitalInvoiceProceedView: UIView { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false label.font = configuration.textStyleFonts[.title2Bold] - label.textColor = .giniColorScheme().text.primary.uiColor() + label.textColor = .giniBankColorScheme().text.primary.uiColor() label.adjustsFontForContentSizeCategory = true label.adjustsFontSizeToFitWidth = true label.setContentHuggingPriority(.defaultHigh, for: .horizontal) @@ -57,7 +57,7 @@ class DigitalInvoiceProceedView: UIView { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false label.font = configuration.textStyleFonts[.footnoteBold] - label.textColor = .giniColorScheme().badge.content.uiColor() + label.textColor = .giniBankColorScheme().badge.content.uiColor() label.adjustsFontForContentSizeCategory = true label.adjustsFontSizeToFitWidth = true label.setContentHuggingPriority(.defaultLow, for: .horizontal) @@ -67,7 +67,7 @@ class DigitalInvoiceProceedView: UIView { private lazy var skontoBadgeView: UIView = { let view = UIView() - view.backgroundColor = .giniColorScheme().badge.background.uiColor() + view.backgroundColor = .giniBankColorScheme().badge.background.uiColor() view.layer.cornerRadius = Constants.cornerRadius view.layer.masksToBounds = true view.isHidden = true @@ -80,7 +80,7 @@ class DigitalInvoiceProceedView: UIView { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false label.font = configuration.textStyleFonts[.footnoteBold] - label.textColor = .giniColorScheme().badge.background.uiColor() + label.textColor = .giniBankColorScheme().badge.background.uiColor() label.adjustsFontForContentSizeCategory = true label.adjustsFontSizeToFitWidth = true return label @@ -88,7 +88,7 @@ class DigitalInvoiceProceedView: UIView { private lazy var dividerView: UIView = { let dividerView = UIView() - dividerView.backgroundColor = .giniColorScheme().bottomBar.border.uiColor() + dividerView.backgroundColor = .giniBankColorScheme().bottomBar.border.uiColor() dividerView.translatesAutoresizingMaskIntoConstraints = false return dividerView }() @@ -107,7 +107,7 @@ class DigitalInvoiceProceedView: UIView { } private func setupView() { - backgroundColor = .giniColorScheme().background.secondary.uiColor() + backgroundColor = .giniBankColorScheme().background.secondary.uiColor() translatesAutoresizingMaskIntoConstraints = false addSubview(contentView) diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/ReturnAssistant/DigitalInvoice/Components/DigitalInvoiceSkontoTableViewCell.swift b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/ReturnAssistant/DigitalInvoice/Components/DigitalInvoiceSkontoTableViewCell.swift index 6d4bee061c..09cfd5b879 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/ReturnAssistant/DigitalInvoice/Components/DigitalInvoiceSkontoTableViewCell.swift +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/ReturnAssistant/DigitalInvoice/Components/DigitalInvoiceSkontoTableViewCell.swift @@ -21,7 +21,7 @@ class DigitalInvoiceSkontoTableViewCell: UITableViewCell { let label = UILabel() label.adjustsFontForContentSizeCategory = true label.font = GiniBankConfiguration.shared.textStyleFonts[.body] - label.textColor = .giniColorScheme().text.tertiary.uiColor() + label.textColor = .giniBankColorScheme().text.tertiary.uiColor() label.text = NSLocalizedStringPreferredGiniBankFormat("ginibank.skonto.screen.title", comment: "Skonto discount") label.numberOfLines = 0 @@ -32,7 +32,7 @@ class DigitalInvoiceSkontoTableViewCell: UITableViewCell { let label = UILabel() label.adjustsFontForContentSizeCategory = true label.font = GiniBankConfiguration.shared.textStyleFonts[.caption2] - label.textColor = .giniColorScheme().text.tertiary.uiColor() + label.textColor = .giniBankColorScheme().text.tertiary.uiColor() label.numberOfLines = 0 return label }() @@ -41,7 +41,7 @@ class DigitalInvoiceSkontoTableViewCell: UITableViewCell { let label = UILabel() label.adjustsFontForContentSizeCategory = true label.font = GiniBankConfiguration.shared.textStyleFonts[.bodyBold] - label.textColor = .giniColorScheme().text.success.uiColor() + label.textColor = .giniBankColorScheme().text.success.uiColor() return label }() @@ -100,7 +100,7 @@ class DigitalInvoiceSkontoTableViewCell: UITableViewCell { // MARK: - Setup Methods private func setupViews() { selectionStyle = .none - backgroundColor = .giniColorScheme().container.background.uiColor() + backgroundColor = .giniBankColorScheme().container.background.uiColor() clipsToBounds = true layer.cornerRadius = 8 layer.maskedCorners = [.layerMaxXMaxYCorner, .layerMinXMaxYCorner] diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/ReturnAssistant/DigitalInvoiceSkonto/DigitalInvoiceSkontoViewController.swift b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/ReturnAssistant/DigitalInvoiceSkonto/DigitalInvoiceSkontoViewController.swift index bd0f7d9689..b95e671c76 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/ReturnAssistant/DigitalInvoiceSkonto/DigitalInvoiceSkontoViewController.swift +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/ReturnAssistant/DigitalInvoiceSkonto/DigitalInvoiceSkontoViewController.swift @@ -35,7 +35,7 @@ class DigitalInvoiceSkontoViewController: UIViewController { private lazy var withDiscountContainerView: UIView = { let view = UIView() view.translatesAutoresizingMaskIntoConstraints = false - view.backgroundColor = .giniColorScheme().container.background.uiColor() + view.backgroundColor = .giniBankColorScheme().container.background.uiColor() view.layer.cornerRadius = Constants.groupCornerRadius return view }() @@ -114,7 +114,7 @@ class DigitalInvoiceSkontoViewController: UIViewController { let backButtonTitle = NSLocalizedStringPreferredGiniBankFormat("ginibank.skonto.backbutton.title", comment: "Back") edgesForExtendedLayout = [] - view.backgroundColor = .giniColorScheme().background.primary.uiColor() + view.backgroundColor = .giniBankColorScheme().background.primary.uiColor() if !configuration.bottomNavigationBarEnabled { let helpButton = GiniBarButton(ofType: .help) helpButton.addAction(self, #selector(helpButtonTapped)) diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/BottomNavigation/DefaultSkontoBottomNavigationBar.swift b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/BottomNavigation/DefaultSkontoBottomNavigationBar.swift index 48253fe8ce..8e26836269 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/BottomNavigation/DefaultSkontoBottomNavigationBar.swift +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/BottomNavigation/DefaultSkontoBottomNavigationBar.swift @@ -52,7 +52,7 @@ final class DefaultSkontoBottomNavigationBar: UIView { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false label.font = configuration.textStyleFonts[.subheadline] - label.textColor = .giniColorScheme().text.primary.uiColor() + label.textColor = .giniBankColorScheme().text.primary.uiColor() label.adjustsFontForContentSizeCategory = true let text = NSLocalizedStringPreferredGiniBankFormat("ginibank.skonto.total.title", comment: "Total") @@ -64,7 +64,7 @@ final class DefaultSkontoBottomNavigationBar: UIView { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false label.font = configuration.textStyleFonts[.title2Bold] - label.textColor = .giniColorScheme().text.primary.uiColor() + label.textColor = .giniBankColorScheme().text.primary.uiColor() label.adjustsFontForContentSizeCategory = true label.adjustsFontSizeToFitWidth = true label.setContentHuggingPriority(.defaultHigh, for: .horizontal) @@ -86,7 +86,7 @@ final class DefaultSkontoBottomNavigationBar: UIView { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false label.font = configuration.textStyleFonts[.footnoteBold] - label.textColor = .giniColorScheme().badge.content.uiColor() + label.textColor = .giniBankColorScheme().badge.content.uiColor() label.adjustsFontForContentSizeCategory = true label.adjustsFontSizeToFitWidth = true label.setContentHuggingPriority(.defaultLow, for: .horizontal) @@ -96,7 +96,7 @@ final class DefaultSkontoBottomNavigationBar: UIView { private lazy var skontoBadgeView: UIView = { let view = UIView() - view.backgroundColor = .giniColorScheme().badge.background.uiColor() + view.backgroundColor = .giniBankColorScheme().badge.background.uiColor() view.layer.cornerRadius = Constants.cornerRadius view.layer.masksToBounds = true view.translatesAutoresizingMaskIntoConstraints = false @@ -108,7 +108,7 @@ final class DefaultSkontoBottomNavigationBar: UIView { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false label.font = configuration.textStyleFonts[.footnoteBold] - label.textColor = .giniColorScheme().text.success.uiColor() + label.textColor = .giniBankColorScheme().text.success.uiColor() label.adjustsFontForContentSizeCategory = true label.adjustsFontSizeToFitWidth = true return label @@ -116,7 +116,7 @@ final class DefaultSkontoBottomNavigationBar: UIView { private lazy var dividerView: UIView = { let dividerView = UIView() - dividerView.backgroundColor = .giniColorScheme().bottomBar.border.uiColor() + dividerView.backgroundColor = .giniBankColorScheme().bottomBar.border.uiColor() dividerView.translatesAutoresizingMaskIntoConstraints = false return dividerView }() @@ -161,7 +161,7 @@ final class DefaultSkontoBottomNavigationBar: UIView { } private func setupView() { - backgroundColor = .giniColorScheme().bottomBar.background.uiColor() + backgroundColor = .giniBankColorScheme().bottomBar.background.uiColor() addSubview(contentView) addSubview(dividerView) diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Help/SkontoHelpViewController.swift b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Help/SkontoHelpViewController.swift index 89eab01d75..8525a787ca 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Help/SkontoHelpViewController.swift +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Help/SkontoHelpViewController.swift @@ -72,7 +72,7 @@ final class SkontoHelpViewController: UIViewController { private func setupViews() { title = NSLocalizedStringPreferredGiniBankFormat("ginibank.skonto.help.screen.title", comment: "Help") - view.backgroundColor = .giniColorScheme().background.primary.uiColor() + view.backgroundColor = .giniBankColorScheme().background.primary.uiColor() view.addSubview(scrollView) scrollView.addSubview(contentView) contentView.addSubview(stackView) diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Help/Views/SkontoHelpFooterView.swift b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Help/Views/SkontoHelpFooterView.swift index 517369282b..241a949b70 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Help/Views/SkontoHelpFooterView.swift +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Help/Views/SkontoHelpFooterView.swift @@ -12,7 +12,7 @@ class SkontoHelpFooterView: UIView { titleLabel.text = NSLocalizedStringPreferredGiniBankFormat("ginibank.skonto.help.footer.title", comment: "Take a photo of your invoice...") titleLabel.translatesAutoresizingMaskIntoConstraints = false - titleLabel.textColor = .giniColorScheme().text.secondary.uiColor() + titleLabel.textColor = .giniBankColorScheme().text.secondary.uiColor() titleLabel.font = configuration.textStyleFonts[.body] titleLabel.adjustsFontForContentSizeCategory = true titleLabel.numberOfLines = Constants.labelNumberOfLines diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Help/Views/SkontoHelpHeaderView.swift b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Help/Views/SkontoHelpHeaderView.swift index b2f69a8ac3..86e0a6ffcc 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Help/Views/SkontoHelpHeaderView.swift +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Help/Views/SkontoHelpHeaderView.swift @@ -12,7 +12,7 @@ class SkontoHelpHeaderView: UIView { titleLabel.text = NSLocalizedStringPreferredGiniBankFormat("ginibank.skonto.help.header.title", comment: "Save money by paying promptly") titleLabel.translatesAutoresizingMaskIntoConstraints = false - titleLabel.textColor = .giniColorScheme().text.primary.uiColor() + titleLabel.textColor = .giniBankColorScheme().text.primary.uiColor() titleLabel.font = configuration.textStyleFonts[.bodyBold] titleLabel.adjustsFontForContentSizeCategory = true titleLabel.numberOfLines = Constants.labelNumberOfLines @@ -24,7 +24,7 @@ class SkontoHelpHeaderView: UIView { titleLabel.text = NSLocalizedStringPreferredGiniBankFormat("ginibank.skonto.help.header.subtitle", comment: "Many companies offer Skonto discounts...") titleLabel.translatesAutoresizingMaskIntoConstraints = false - titleLabel.textColor = .giniColorScheme().text.secondary.uiColor() + titleLabel.textColor = .giniBankColorScheme().text.secondary.uiColor() titleLabel.font = configuration.textStyleFonts[.body] titleLabel.adjustsFontForContentSizeCategory = true titleLabel.numberOfLines = Constants.labelNumberOfLines diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Help/Views/SkontoHelpItemView.swift b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Help/Views/SkontoHelpItemView.swift index bc1b8653e6..7f1a0c0078 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Help/Views/SkontoHelpItemView.swift +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Help/Views/SkontoHelpItemView.swift @@ -16,7 +16,7 @@ final class SkontoHelpItemView: UIView { private lazy var titleLabel: UILabel = { let titleLabel = UILabel() titleLabel.translatesAutoresizingMaskIntoConstraints = false - titleLabel.textColor = .giniColorScheme().text.primary.uiColor() + titleLabel.textColor = .giniBankColorScheme().text.primary.uiColor() titleLabel.font = configuration.textStyleFonts[.footnoteBold] titleLabel.adjustsFontForContentSizeCategory = true titleLabel.numberOfLines = Constants.labelNumberOfLines @@ -82,7 +82,7 @@ final class SkontoHelpItemView: UIView { private func addDividerView() { let dividerView = UIView() dividerView.translatesAutoresizingMaskIntoConstraints = false - dividerView.backgroundColor = .giniColorScheme().textField.border.uiColor() + dividerView.backgroundColor = .giniBankColorScheme().textField.border.uiColor() addSubview(dividerView) NSLayoutConstraint.activate([ dividerView.bottomAnchor.constraint(equalTo: bottomAnchor), diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Help/Views/SkontoHelpItemsContainerView.swift b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Help/Views/SkontoHelpItemsContainerView.swift index af0d21d5d0..0533f2c514 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Help/Views/SkontoHelpItemsContainerView.swift +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Help/Views/SkontoHelpItemsContainerView.swift @@ -31,7 +31,7 @@ class SkontoHelpItemsContainerView: UIView { } private func setupView() { - backgroundColor = .giniColorScheme().background.secondary.uiColor() + backgroundColor = .giniBankColorScheme().background.secondary.uiColor() layer.cornerRadius = Constants.cornerRadius layer.masksToBounds = true diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/SkontoViewController.swift b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/SkontoViewController.swift index 0e876f452c..75693f6eac 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/SkontoViewController.swift +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/SkontoViewController.swift @@ -35,7 +35,7 @@ final class SkontoViewController: UIViewController { private lazy var withDiscountContainerView: UIView = { let view = UIView() view.translatesAutoresizingMaskIntoConstraints = false - view.backgroundColor = .giniColorScheme().container.background.uiColor() + view.backgroundColor = .giniBankColorScheme().container.background.uiColor() view.layer.cornerRadius = Constants.groupCornerRadius return view }() @@ -54,7 +54,7 @@ final class SkontoViewController: UIViewController { private lazy var withoutDiscountContainerView: UIView = { let view = UIView() view.translatesAutoresizingMaskIntoConstraints = false - view.backgroundColor = .giniColorScheme().container.background.uiColor() + view.backgroundColor = .giniBankColorScheme().container.background.uiColor() view.layer.cornerRadius = Constants.groupCornerRadius return view }() @@ -130,7 +130,7 @@ final class SkontoViewController: UIViewController { let backButtonTitle = NSLocalizedStringPreferredGiniBankFormat("ginibank.skonto.backbutton.title", comment: "Back") edgesForExtendedLayout = [] - view.backgroundColor = .giniColorScheme().background.primary.uiColor() + view.backgroundColor = .giniBankColorScheme().background.primary.uiColor() if !configuration.bottomNavigationBarEnabled { let helpButton = GiniBarButton(ofType: .help) helpButton.addAction(self, #selector(helpButtonTapped)) diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Views/SkontoAmountToPayView.swift b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Views/SkontoAmountToPayView.swift index f665d8b55b..032e01801b 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Views/SkontoAmountToPayView.swift +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Views/SkontoAmountToPayView.swift @@ -16,7 +16,7 @@ class SkontoAmountToPayView: UIView { let label = UILabel() label.text = titleLabelText label.font = configuration.textStyleFonts[.footnote] - label.textColor = .giniColorScheme().text.secondary.uiColor() + label.textColor = .giniBankColorScheme().text.secondary.uiColor() label.adjustsFontForContentSizeCategory = true label.translatesAutoresizingMaskIntoConstraints = false return label @@ -26,7 +26,7 @@ class SkontoAmountToPayView: UIView { let textField = PriceTextField() textField.priceDelegate = self textField.text = textFieldInitialText - textField.textColor = .giniColorScheme().text.primary.uiColor() + textField.textColor = .giniBankColorScheme().text.primary.uiColor() textField.font = configuration.textStyleFonts[.body] textField.borderStyle = .none textField.keyboardType = .numberPad @@ -42,7 +42,7 @@ class SkontoAmountToPayView: UIView { private lazy var currencyLabel: UILabel = { let label = UILabel() label.text = currencyLabelText - label.textColor = .giniColorScheme().text.secondary.uiColor() + label.textColor = .giniBankColorScheme().text.secondary.uiColor() label.font = configuration.textStyleFonts[.body] label.adjustsFontForContentSizeCategory = true label.setContentHuggingPriority(.defaultHigh, for: .horizontal) @@ -62,7 +62,7 @@ class SkontoAmountToPayView: UIView { private lazy var containerView: UIView = { let view = UIView() - view.layer.borderColor = UIColor.giniColorScheme().textField.border.uiColor().cgColor + view.layer.borderColor = UIColor.giniBankColorScheme().textField.border.uiColor().cgColor view.layer.borderWidth = isEditable ? 1 : 0 view.layer.cornerRadius = Constants.cornerRadius view.isAccessibilityElement = true @@ -79,7 +79,7 @@ class SkontoAmountToPayView: UIView { private lazy var validationLabel: UILabel = { let label = UILabel() - label.textColor = .giniColorScheme().textField.supportingError.uiColor() + label.textColor = .giniBankColorScheme().textField.supportingError.uiColor() label.font = configuration.textStyleFonts[.caption1] label.numberOfLines = 0 label.isHidden = true @@ -119,7 +119,7 @@ class SkontoAmountToPayView: UIView { private func setupView() { translatesAutoresizingMaskIntoConstraints = false - backgroundColor = .giniColorScheme().textField.background.uiColor() + backgroundColor = .giniBankColorScheme().textField.background.uiColor() addSubview(mainStackView) containerView.addSubview(titleLabel) containerView.addSubview(stackView) diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Views/SkontoDocumentPreviewView.swift b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Views/SkontoDocumentPreviewView.swift index 1b8ad66094..9c5ffa9953 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Views/SkontoDocumentPreviewView.swift +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Views/SkontoDocumentPreviewView.swift @@ -14,7 +14,7 @@ protocol SkontoDocumentPreviewViewDelegate: AnyObject { class SkontoDocumentPreviewView: UIView { private lazy var imageContainerView: UIView = { let view = UIView() - view.backgroundColor = .giniColorScheme().placeholder.background.uiColor() + view.backgroundColor = .giniBankColorScheme().placeholder.background.uiColor() view.layer.cornerRadius = Constants.imageViewCornerRadius view.translatesAutoresizingMaskIntoConstraints = false return view @@ -23,7 +23,7 @@ class SkontoDocumentPreviewView: UIView { private lazy var documentPreviewImageView: UIImageView = { let imageView = UIImageView() imageView.image = GiniImages.invoicePlaceholderIcon.image - imageView.tintColor = .giniColorScheme().placeholder.tint.uiColor() + imageView.tintColor = .giniBankColorScheme().placeholder.tint.uiColor() imageView.contentMode = .scaleAspectFit imageView.translatesAutoresizingMaskIntoConstraints = false return imageView @@ -34,7 +34,7 @@ class SkontoDocumentPreviewView: UIView { let title = NSLocalizedStringPreferredGiniBankFormat("ginibank.skonto.invoice.title", comment: "Invoice") label.text = title - label.textColor = .giniColorScheme().text.primary.uiColor() + label.textColor = .giniBankColorScheme().text.primary.uiColor() label.font = configuration.textStyleFonts[.footnoteBold] label.adjustsFontForContentSizeCategory = true label.translatesAutoresizingMaskIntoConstraints = false @@ -46,7 +46,7 @@ class SkontoDocumentPreviewView: UIView { let title = NSLocalizedStringPreferredGiniBankFormat("ginibank.skonto.invoice.subtitle", comment: "Tap to view") label.text = title - label.textColor = .giniColorScheme().text.secondary.uiColor() + label.textColor = .giniBankColorScheme().text.secondary.uiColor() label.font = configuration.textStyleFonts[.footnote] label.adjustsFontForContentSizeCategory = true label.translatesAutoresizingMaskIntoConstraints = false @@ -72,7 +72,7 @@ class SkontoDocumentPreviewView: UIView { private lazy var contentView: UIView = { let view = UIView() view.translatesAutoresizingMaskIntoConstraints = false - view.backgroundColor = .giniColorScheme().container.background.uiColor() + view.backgroundColor = .giniBankColorScheme().container.background.uiColor() view.layer.cornerRadius = Constants.groupCornerRadius let tapGesture = UITapGestureRecognizer(target: self, action: #selector(documentPreviewTapped)) view.addGestureRecognizer(tapGesture) diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Views/SkontoExpiryDateView.swift b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Views/SkontoExpiryDateView.swift index ec2e0bad31..81c26cdf88 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Views/SkontoExpiryDateView.swift +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Views/SkontoExpiryDateView.swift @@ -16,7 +16,7 @@ class SkontoExpiryDateView: UIView { let label = UILabel() label.text = title label.font = configuration.textStyleFonts[.footnote] - label.textColor = .giniColorScheme().text.secondary.uiColor() + label.textColor = .giniBankColorScheme().text.secondary.uiColor() label.adjustsFontForContentSizeCategory = true label.translatesAutoresizingMaskIntoConstraints = false return label @@ -25,7 +25,7 @@ class SkontoExpiryDateView: UIView { private lazy var textField: TextFieldActionsDisabled = { let textField = TextFieldActionsDisabled() textField.text = viewModel.dueDate.currentShortString - textField.textColor = .giniColorScheme().text.primary.uiColor() + textField.textColor = .giniBankColorScheme().text.primary.uiColor() textField.font = configuration.textStyleFonts[.body] textField.borderStyle = .none textField.adjustsFontForContentSizeCategory = true @@ -35,7 +35,7 @@ class SkontoExpiryDateView: UIView { private lazy var calendarImageView: UIImageView = { let imageView = UIImageView(image: GiniImages.calendar.image) - imageView.tintColor = .giniColorScheme().placeholder.tint.uiColor() + imageView.tintColor = .giniBankColorScheme().placeholder.tint.uiColor() imageView.contentMode = .scaleAspectFit imageView.translatesAutoresizingMaskIntoConstraints = false return imageView @@ -43,7 +43,7 @@ class SkontoExpiryDateView: UIView { private lazy var containerView: UIView = { let view = UIView() - view.layer.borderColor = UIColor.giniColorScheme().textField.border.uiColor().cgColor + view.layer.borderColor = UIColor.giniBankColorScheme().textField.border.uiColor().cgColor view.layer.borderWidth = 1 view.layer.cornerRadius = Constants.cornerRadius view.translatesAutoresizingMaskIntoConstraints = false @@ -70,7 +70,7 @@ class SkontoExpiryDateView: UIView { private func setupView() { translatesAutoresizingMaskIntoConstraints = false isAccessibilityElement = true - backgroundColor = .giniColorScheme().textField.background.uiColor() + backgroundColor = .giniBankColorScheme().textField.background.uiColor() addSubview(containerView) containerView.addSubview(titleLabel) containerView.addSubview(textField) diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Views/SkontoInfoBannerView.swift b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Views/SkontoInfoBannerView.swift index 66efd1b7a7..b45c8a8a47 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Views/SkontoInfoBannerView.swift +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Views/SkontoInfoBannerView.swift @@ -42,7 +42,7 @@ class SkontoInfoBannerView: UIView { private func setupView() { translatesAutoresizingMaskIntoConstraints = false isAccessibilityElement = true - backgroundColor = .giniColorScheme().message.backgroundSuccess.uiColor() + backgroundColor = .giniBankColorScheme().message.backgroundSuccess.uiColor() layer.cornerRadius = Constants.cornerRadius layer.masksToBounds = true addSubview(imageView) @@ -99,14 +99,14 @@ class SkontoInfoBannerView: UIView { switch edgeCase { case .expired: - tintColor = .giniColorScheme().message.contentError.uiColor() - backgroundColor = .giniColorScheme().message.backgroundError.uiColor() + tintColor = .giniBankColorScheme().message.contentError.uiColor() + backgroundColor = .giniBankColorScheme().message.backgroundError.uiColor() case .paymentToday, .payByCash: - tintColor = .giniColorScheme().message.contentWarning.uiColor() - backgroundColor = .giniColorScheme().message.backgroundWarning.uiColor() + tintColor = .giniBankColorScheme().message.contentWarning.uiColor() + backgroundColor = .giniBankColorScheme().message.backgroundWarning.uiColor() default: - tintColor = .giniColorScheme().message.contentSuccess.uiColor() - backgroundColor = .giniColorScheme().message.backgroundSuccess.uiColor() + tintColor = .giniBankColorScheme().message.contentSuccess.uiColor() + backgroundColor = .giniBankColorScheme().message.backgroundSuccess.uiColor() } label.textColor = tintColor diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Views/SkontoProceedContainerView.swift b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Views/SkontoProceedContainerView.swift index 390f24204d..7a6cc2879d 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Views/SkontoProceedContainerView.swift +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Views/SkontoProceedContainerView.swift @@ -32,7 +32,7 @@ class SkontoProceedContainerView: UIView { label.translatesAutoresizingMaskIntoConstraints = false label.adjustsFontForContentSizeCategory = true label.font = configuration.textStyleFonts[.subheadline] - label.textColor = .giniColorScheme().text.primary.uiColor() + label.textColor = .giniBankColorScheme().text.primary.uiColor() let labelText = NSLocalizedStringPreferredGiniBankFormat("ginibank.skonto.total.title", comment: "Total") label.text = labelText @@ -43,7 +43,7 @@ class SkontoProceedContainerView: UIView { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false label.font = configuration.textStyleFonts[.title2Bold] - label.textColor = .giniColorScheme().text.primary.uiColor() + label.textColor = .giniBankColorScheme().text.primary.uiColor() let labelText = viewModel.finalAmountToPay.localizedStringWithCurrencyCode label.text = labelText label.adjustsFontForContentSizeCategory = true @@ -67,7 +67,7 @@ class SkontoProceedContainerView: UIView { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false label.font = configuration.textStyleFonts[.footnoteBold] - label.textColor = .giniColorScheme().badge.content.uiColor() + label.textColor = .giniBankColorScheme().badge.content.uiColor() let labelText = String.localizedStringWithFormat(skontoTitle, viewModel.formattedPercentageDiscounted) label.text = labelText @@ -80,7 +80,7 @@ class SkontoProceedContainerView: UIView { private lazy var skontoBadgeView: UIView = { let view = UIView() - view.backgroundColor = .giniColorScheme().badge.background.uiColor() + view.backgroundColor = .giniBankColorScheme().badge.background.uiColor() view.layer.cornerRadius = Constants.cornerRadius view.layer.masksToBounds = true view.translatesAutoresizingMaskIntoConstraints = false @@ -92,7 +92,7 @@ class SkontoProceedContainerView: UIView { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false label.font = configuration.textStyleFonts[.footnoteBold] - label.textColor = .giniColorScheme().badge.background.uiColor() + label.textColor = .giniBankColorScheme().badge.background.uiColor() let labelText = viewModel.savingsAmountString label.text = labelText label.adjustsFontForContentSizeCategory = true @@ -102,7 +102,7 @@ class SkontoProceedContainerView: UIView { private lazy var dividerView: UIView = { let dividerView = UIView() - dividerView.backgroundColor = .giniColorScheme().bottomBar.border.uiColor() + dividerView.backgroundColor = .giniBankColorScheme().bottomBar.border.uiColor() dividerView.translatesAutoresizingMaskIntoConstraints = false return dividerView }() @@ -125,7 +125,7 @@ class SkontoProceedContainerView: UIView { } private func setupView() { - backgroundColor = .giniColorScheme().bottomBar.background.uiColor() + backgroundColor = .giniBankColorScheme().bottomBar.background.uiColor() translatesAutoresizingMaskIntoConstraints = false addSubview(contentView) diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Views/SkontoWithDiscountHeaderView.swift b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Views/SkontoWithDiscountHeaderView.swift index 31b6f3085b..d325dbdb4e 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Views/SkontoWithDiscountHeaderView.swift +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Views/SkontoWithDiscountHeaderView.swift @@ -13,7 +13,7 @@ class SkontoWithDiscountHeaderView: UIView { let title = NSLocalizedStringPreferredGiniBankFormat("ginibank.skonto.withdiscount.title", comment: "With Skonto discount") label.text = title - label.textColor = .giniColorScheme().text.primary.uiColor() + label.textColor = .giniBankColorScheme().text.primary.uiColor() label.font = configuration.textStyleFonts[.bodyBold] label.adjustsFontForContentSizeCategory = true label.numberOfLines = 0 @@ -29,7 +29,7 @@ class SkontoWithDiscountHeaderView: UIView { comment: "• Active") label.text = title label.font = configuration.textStyleFonts[.footnoteBold] - label.textColor = UIColor.giniColorScheme().text.success.uiColor() + label.textColor = UIColor.giniBankColorScheme().text.success.uiColor() label.adjustsFontForContentSizeCategory = true label.setContentHuggingPriority(.defaultLow, for: .horizontal) label.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal) @@ -40,7 +40,7 @@ class SkontoWithDiscountHeaderView: UIView { private lazy var discountSwitch: UISwitch = { let discountSwitch = UISwitch() discountSwitch.isOn = viewModel.isSkontoApplied - discountSwitch.onTintColor = .giniColorScheme().toggle.trackOn.uiColor() + discountSwitch.onTintColor = .giniBankColorScheme().toggle.trackOn.uiColor() discountSwitch.addTarget(self, action: #selector(discountSwitchToggled(_:)), for: .valueChanged) discountSwitch.translatesAutoresizingMaskIntoConstraints = false return discountSwitch @@ -82,7 +82,7 @@ class SkontoWithDiscountHeaderView: UIView { private func setupView() { translatesAutoresizingMaskIntoConstraints = false - backgroundColor = .giniColorScheme().container.background.uiColor() + backgroundColor = .giniBankColorScheme().container.background.uiColor() addSubview(stackView) addSubview(discountSwitch) setupConstraints() diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Views/SkontoWithoutDiscountView.swift b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Views/SkontoWithoutDiscountView.swift index 5a01c9d960..258c29eaf0 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Views/SkontoWithoutDiscountView.swift +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Views/SkontoWithoutDiscountView.swift @@ -12,7 +12,7 @@ class SkontoWithoutDiscountView: UIView { let title = NSLocalizedStringPreferredGiniBankFormat("ginibank.skonto.withoutdiscount.title", comment: "Without Skonto discount") label.text = title - label.textColor = .giniColorScheme().text.primary.uiColor() + label.textColor = .giniBankColorScheme().text.primary.uiColor() label.font = configuration.textStyleFonts[.bodyBold] label.adjustsFontForContentSizeCategory = true label.numberOfLines = 0 @@ -28,7 +28,7 @@ class SkontoWithoutDiscountView: UIView { comment: "• Active") label.text = title label.font = configuration.textStyleFonts[.footnoteBold] - label.textColor = UIColor.giniColorScheme().text.success.uiColor() + label.textColor = UIColor.giniBankColorScheme().text.success.uiColor() label.adjustsFontForContentSizeCategory = true label.setContentHuggingPriority(.defaultLow, for: .horizontal) label.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal) @@ -75,7 +75,7 @@ class SkontoWithoutDiscountView: UIView { private func setupView() { translatesAutoresizingMaskIntoConstraints = false - backgroundColor = .giniColorScheme().container.background.uiColor() + backgroundColor = .giniBankColorScheme().container.background.uiColor() addSubview(stackView) addSubview(priceView) setupConstraints() diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/TransactionDocs/Components/TransactionDocsHeaderView.swift b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/TransactionDocs/Components/TransactionDocsHeaderView.swift index 49f072baea..ccd91ba19d 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/TransactionDocs/Components/TransactionDocsHeaderView.swift +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/TransactionDocs/Components/TransactionDocsHeaderView.swift @@ -13,7 +13,7 @@ class TransactionDocsHeaderView: UIView { comment: "Attachments") label.text = text label.font = configuration.textStyleFonts[.footnoteBold] - label.textColor = .giniColorScheme().text.primary.uiColor() + label.textColor = .giniBankColorScheme().text.primary.uiColor() label.isAccessibilityElement = true label.accessibilityLabel = text label.adjustsFontForContentSizeCategory = true diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/TransactionDocs/Components/TransactionDocsItemView.swift b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/TransactionDocs/Components/TransactionDocsItemView.swift index ea805dc884..35b4513152 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/TransactionDocs/Components/TransactionDocsItemView.swift +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/TransactionDocs/Components/TransactionDocsItemView.swift @@ -10,7 +10,7 @@ import GiniCaptureSDK class TransactionDocsItemView: UIView { private lazy var imageContainerView: UIView = { let view = UIView() - view.backgroundColor = .giniColorScheme().placeholder.background.uiColor() + view.backgroundColor = .giniBankColorScheme().placeholder.background.uiColor() view.layer.cornerRadius = Constants.imageViewCornerRadius view.translatesAutoresizingMaskIntoConstraints = false return view @@ -19,14 +19,14 @@ class TransactionDocsItemView: UIView { private lazy var iconImageView: UIImageView = { let imageView = UIImageView() imageView.contentMode = .scaleAspectFit - imageView.tintColor = .giniColorScheme().placeholder.tint.uiColor() + imageView.tintColor = .giniBankColorScheme().placeholder.tint.uiColor() return imageView }() private lazy var fileNameLabel: UILabel = { let label = UILabel() label.font = configuration.textStyleFonts[.body] - label.textColor = .giniColorScheme().text.primary.uiColor() + label.textColor = .giniBankColorScheme().text.primary.uiColor() label.numberOfLines = Constants.fileNameLabelNumberOfLines label.lineBreakMode = .byWordWrapping label.adjustsFontForContentSizeCategory = true @@ -36,7 +36,7 @@ class TransactionDocsItemView: UIView { private lazy var optionsButton: UIButton = { let button = UIButton() button.setImage(GiniImages.transactionDocsOptionsIcon.image, for: .normal) - button.tintColor = .giniColorScheme().icon.primary.uiColor() + button.tintColor = .giniBankColorScheme().icon.primary.uiColor() button.addTarget(self, action: #selector(optionsButtonTapped), for: .touchUpInside) return button }() diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Resources/GiniColorScheme.swift b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Resources/GiniBankColorScheme.swift similarity index 75% rename from BankSDK/GiniBankSDK/Sources/GiniBankSDK/Resources/GiniColorScheme.swift rename to BankSDK/GiniBankSDK/Sources/GiniBankSDK/Resources/GiniBankColorScheme.swift index 10fb4f38ab..e17919cb56 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Resources/GiniColorScheme.swift +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Resources/GiniBankColorScheme.swift @@ -7,145 +7,8 @@ import UIKit import GiniUtilites -struct GiniColorScheme { - struct Background { - var primary: GiniColor - var secondary: GiniColor - } - - struct ActionSheet { - var buttonBackground: GiniColor - var cancelButtonBackground: GiniColor - } - - struct Alert { - var background: GiniColor - var divider: GiniColor - } - - struct NavigationBar { - var background: GiniColor - var action: GiniColor - var navigation: GiniColor - } - - struct Content { - var navigation: GiniColor - var text: GiniColor - } - - struct BottomBar { - var background: GiniColor - var border: GiniColor - } - - struct Container { - var background: GiniColor - } - - struct Placeholder { - var background: GiniColor - var tint: GiniColor - } - - struct Text { - var primary: GiniColor - var secondary: GiniColor - var tertiary: GiniColor - var accent: GiniColor - var success: GiniColor - var error: GiniColor - } - - struct Icon { - var primary: GiniColor - var secondary: GiniColor - } - - struct PageController { - var selected: GiniColor - var unselected: GiniColor - } - - struct Error { - var background: GiniColor - var icon: GiniColor - } - - struct Message { - var backgroundSuccess: GiniColor - var contentSuccess: GiniColor - var backgroundWarning: GiniColor - var contentWarning: GiniColor - var backgroundError: GiniColor - var contentError: GiniColor - } - - struct Badge { - var background: GiniColor - var content: GiniColor - } - - struct Button { - var background: GiniColor - var backgroundLoading: GiniColor - var content: GiniColor - } - - struct ButtonOutlined { - var background: GiniColor - var content: GiniColor - } - - struct TextField { - var background: GiniColor - var border: GiniColor - var focusedText: GiniColor - var unfocusedText: GiniColor - var disabledText: GiniColor - var errorText: GiniColor - var labelFocused: GiniColor - var labelUnfocused: GiniColor - var labelDisabled: GiniColor - var labelError: GiniColor - var supportingFocused: GiniColor - var supportingUnfocused: GiniColor - var supportingDisabled: GiniColor - var supportingError: GiniColor - var trailingFocused: GiniColor - var cursorEnabled: GiniColor - var cursorError: GiniColor - } - - struct Toggle { - var thumb: GiniColor - var trackOn: GiniColor - var trackOff: GiniColor - var disabledTrack: GiniColor - } - - var background: Background - var actionSheet: ActionSheet - var alert: Alert - var navigationBar: NavigationBar - var content: Content - var bottomBar: BottomBar - var container: Container - var placeholder: Placeholder - var text: Text - var icon: Icon - var pageController: PageController - var error: Error - var message: Message - var badge: Badge - var button: Button - var buttonOutlined: ButtonOutlined - var textField: TextField - var toggle: Toggle -} - extension UIColor { - static func giniColorScheme() -> GiniColorScheme { + static func giniBankColorScheme() -> GiniColorScheme { return GiniColorScheme( background: createBackgroundColorScheme(), actionSheet: createActionSheetColorScheme(), diff --git a/GiniComponents/GiniUtilites/Sources/GiniUtilites/Color/GiniColorScheme.swift b/GiniComponents/GiniUtilites/Sources/GiniUtilites/Color/GiniColorScheme.swift new file mode 100644 index 0000000000..c811bb686f --- /dev/null +++ b/GiniComponents/GiniUtilites/Sources/GiniUtilites/Color/GiniColorScheme.swift @@ -0,0 +1,281 @@ +// +// GiniColorScheme.swift +// +// Copyright © 2024 Gini GmbH. All rights reserved. +// + +import UIKit + +public struct GiniColorScheme { + public struct Background { + public var primary: GiniColor + public var secondary: GiniColor + + public init(primary: GiniColor, secondary: GiniColor) { + self.primary = primary + self.secondary = secondary + } + } + + public struct ActionSheet { + public var buttonBackground: GiniColor + public var cancelButtonBackground: GiniColor + + public init(buttonBackground: GiniColor, cancelButtonBackground: GiniColor) { + self.buttonBackground = buttonBackground + self.cancelButtonBackground = cancelButtonBackground + } + } + + public struct Alert { + public var background: GiniColor + public var divider: GiniColor + + public init(background: GiniColor, divider: GiniColor) { + self.background = background + self.divider = divider + } + } + + public struct NavigationBar { + public var background: GiniColor + public var action: GiniColor + public var navigation: GiniColor + + public init(background: GiniColor, action: GiniColor, navigation: GiniColor) { + self.background = background + self.action = action + self.navigation = navigation + } + } + + public struct Content { + public var navigation: GiniColor + public var text: GiniColor + + public init(navigation: GiniColor, text: GiniColor) { + self.navigation = navigation + self.text = text + } + } + + public struct BottomBar { + public var background: GiniColor + public var border: GiniColor + + public init(background: GiniColor, border: GiniColor) { + self.background = background + self.border = border + } + } + + public struct Container { + public var background: GiniColor + + public init(background: GiniColor) { + self.background = background + } + } + + public struct Placeholder { + public var background: GiniColor + public var tint: GiniColor + + public init(background: GiniColor, tint: GiniColor) { + self.background = background + self.tint = tint + } + } + + public struct Text { + public var primary: GiniColor + public var secondary: GiniColor + public var tertiary: GiniColor + public var accent: GiniColor + public var success: GiniColor + public var error: GiniColor + + public init(primary: GiniColor, secondary: GiniColor, tertiary: GiniColor, accent: GiniColor, success: GiniColor, error: GiniColor) { + self.primary = primary + self.secondary = secondary + self.tertiary = tertiary + self.accent = accent + self.success = success + self.error = error + } + } + + public struct Icon { + public var primary: GiniColor + public var secondary: GiniColor + + public init(primary: GiniColor, secondary: GiniColor) { + self.primary = primary + self.secondary = secondary + } + } + + public struct PageController { + public var selected: GiniColor + public var unselected: GiniColor + + public init(selected: GiniColor, unselected: GiniColor) { + self.selected = selected + self.unselected = unselected + } + } + + public struct Error { + public var background: GiniColor + public var icon: GiniColor + + public init(background: GiniColor, icon: GiniColor) { + self.background = background + self.icon = icon + } + } + + public struct Message { + public var backgroundSuccess: GiniColor + public var contentSuccess: GiniColor + public var backgroundWarning: GiniColor + public var contentWarning: GiniColor + public var backgroundError: GiniColor + public var contentError: GiniColor + + public init(backgroundSuccess: GiniColor, contentSuccess: GiniColor, backgroundWarning: GiniColor, contentWarning: GiniColor, backgroundError: GiniColor, contentError: GiniColor) { + self.backgroundSuccess = backgroundSuccess + self.contentSuccess = contentSuccess + self.backgroundWarning = backgroundWarning + self.contentWarning = contentWarning + self.backgroundError = backgroundError + self.contentError = contentError + } + } + + public struct Badge { + public var background: GiniColor + public var content: GiniColor + + public init(background: GiniColor, content: GiniColor) { + self.background = background + self.content = content + } + } + + public struct Button { + public var background: GiniColor + public var backgroundLoading: GiniColor + public var content: GiniColor + + public init(background: GiniColor, backgroundLoading: GiniColor, content: GiniColor) { + self.background = background + self.backgroundLoading = backgroundLoading + self.content = content + } + } + + public struct ButtonOutlined { + public var background: GiniColor + public var content: GiniColor + + public init(background: GiniColor, content: GiniColor) { + self.background = background + self.content = content + } + } + + public struct TextField { + public var background: GiniColor + public var border: GiniColor + public var focusedText: GiniColor + public var unfocusedText: GiniColor + public var disabledText: GiniColor + public var errorText: GiniColor + public var labelFocused: GiniColor + public var labelUnfocused: GiniColor + public var labelDisabled: GiniColor + public var labelError: GiniColor + public var supportingFocused: GiniColor + public var supportingUnfocused: GiniColor + public var supportingDisabled: GiniColor + public var supportingError: GiniColor + public var trailingFocused: GiniColor + public var cursorEnabled: GiniColor + public var cursorError: GiniColor + + public init(background: GiniColor, border: GiniColor, focusedText: GiniColor, unfocusedText: GiniColor, disabledText: GiniColor, errorText: GiniColor, labelFocused: GiniColor, labelUnfocused: GiniColor, labelDisabled: GiniColor, labelError: GiniColor, supportingFocused: GiniColor, supportingUnfocused: GiniColor, supportingDisabled: GiniColor, supportingError: GiniColor, trailingFocused: GiniColor, cursorEnabled: GiniColor, cursorError: GiniColor) { + self.background = background + self.border = border + self.focusedText = focusedText + self.unfocusedText = unfocusedText + self.disabledText = disabledText + self.errorText = errorText + self.labelFocused = labelFocused + self.labelUnfocused = labelUnfocused + self.labelDisabled = labelDisabled + self.labelError = labelError + self.supportingFocused = supportingFocused + self.supportingUnfocused = supportingUnfocused + self.supportingDisabled = supportingDisabled + self.supportingError = supportingError + self.trailingFocused = trailingFocused + self.cursorEnabled = cursorEnabled + self.cursorError = cursorError + } + } + + public struct Toggle { + public var thumb: GiniColor + public var trackOn: GiniColor + public var trackOff: GiniColor + public var disabledTrack: GiniColor + + public init(thumb: GiniColor, trackOn: GiniColor, trackOff: GiniColor, disabledTrack: GiniColor) { + self.thumb = thumb + self.trackOn = trackOn + self.trackOff = trackOff + self.disabledTrack = disabledTrack + } + } + + public var background: Background + public var actionSheet: ActionSheet + public var alert: Alert + public var navigationBar: NavigationBar + public var content: Content + public var bottomBar: BottomBar + public var container: Container + public var placeholder: Placeholder + public var text: Text + public var icon: Icon + public var pageController: PageController + public var error: Error + public var message: Message + public var badge: Badge + public var button: Button + public var buttonOutlined: ButtonOutlined + public var textField: TextField + public var toggle: Toggle + + public init(background: Background, actionSheet: ActionSheet, alert: Alert, navigationBar: NavigationBar, content: Content, bottomBar: BottomBar, container: Container, placeholder: Placeholder, text: Text, icon: Icon, pageController: PageController, error: Error, message: Message, badge: Badge, button: Button, buttonOutlined: ButtonOutlined, textField: TextField, toggle: Toggle) { + self.background = background + self.actionSheet = actionSheet + self.alert = alert + self.navigationBar = navigationBar + self.content = content + self.bottomBar = bottomBar + self.container = container + self.placeholder = placeholder + self.text = text + self.icon = icon + self.pageController = pageController + self.error = error + self.message = message + self.badge = badge + self.button = button + self.buttonOutlined = buttonOutlined + self.textField = textField + self.toggle = toggle + } +} From 4788c2f47ffb51384324667c64e1bbd508eb4b83 Mon Sep 17 00:00:00 2001 From: Gleb Kulik Date: Tue, 1 Apr 2025 19:18:00 +0200 Subject: [PATCH 024/110] feat(GiniBankSDK): PriceTextField: remove unused import PP-1079 --- .../GiniBankSDK/Core/Skonto/Components/PriceTextField.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Components/PriceTextField.swift b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Components/PriceTextField.swift index 03612494f3..e3c0d2723b 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Components/PriceTextField.swift +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Components/PriceTextField.swift @@ -5,7 +5,6 @@ // import UIKit -import GiniUtilites protocol PriceTextFieldDelegate: AnyObject { func priceTextField(_ textField: PriceTextField, didChangePrice editedText: String) From 8e0df63e26f7df56cd44040c80e7e63fccb0d764 Mon Sep 17 00:00:00 2001 From: Gleb Kulik Date: Wed, 2 Apr 2025 13:36:26 +0200 Subject: [PATCH 025/110] feat(GiniUtilites): GiniColorScheme reformat inits PP-1081 --- .../GiniUtilites/Color/GiniColorScheme.swift | 64 +++++++++++++++++-- 1 file changed, 57 insertions(+), 7 deletions(-) diff --git a/GiniComponents/GiniUtilites/Sources/GiniUtilites/Color/GiniColorScheme.swift b/GiniComponents/GiniUtilites/Sources/GiniUtilites/Color/GiniColorScheme.swift index c811bb686f..fdda866d9b 100644 --- a/GiniComponents/GiniUtilites/Sources/GiniUtilites/Color/GiniColorScheme.swift +++ b/GiniComponents/GiniUtilites/Sources/GiniUtilites/Color/GiniColorScheme.swift @@ -42,7 +42,9 @@ public struct GiniColorScheme { public var action: GiniColor public var navigation: GiniColor - public init(background: GiniColor, action: GiniColor, navigation: GiniColor) { + public init(background: GiniColor, + action: GiniColor, + navigation: GiniColor) { self.background = background self.action = action self.navigation = navigation @@ -95,7 +97,12 @@ public struct GiniColorScheme { public var success: GiniColor public var error: GiniColor - public init(primary: GiniColor, secondary: GiniColor, tertiary: GiniColor, accent: GiniColor, success: GiniColor, error: GiniColor) { + public init(primary: GiniColor, + secondary: GiniColor, + tertiary: GiniColor, + accent: GiniColor, + success: GiniColor, + error: GiniColor) { self.primary = primary self.secondary = secondary self.tertiary = tertiary @@ -143,7 +150,12 @@ public struct GiniColorScheme { public var backgroundError: GiniColor public var contentError: GiniColor - public init(backgroundSuccess: GiniColor, contentSuccess: GiniColor, backgroundWarning: GiniColor, contentWarning: GiniColor, backgroundError: GiniColor, contentError: GiniColor) { + public init(backgroundSuccess: GiniColor, + contentSuccess: GiniColor, + backgroundWarning: GiniColor, + contentWarning: GiniColor, + backgroundError: GiniColor, + contentError: GiniColor) { self.backgroundSuccess = backgroundSuccess self.contentSuccess = contentSuccess self.backgroundWarning = backgroundWarning @@ -168,7 +180,9 @@ public struct GiniColorScheme { public var backgroundLoading: GiniColor public var content: GiniColor - public init(background: GiniColor, backgroundLoading: GiniColor, content: GiniColor) { + public init(background: GiniColor, + backgroundLoading: GiniColor, + content: GiniColor) { self.background = background self.backgroundLoading = backgroundLoading self.content = content @@ -204,7 +218,23 @@ public struct GiniColorScheme { public var cursorEnabled: GiniColor public var cursorError: GiniColor - public init(background: GiniColor, border: GiniColor, focusedText: GiniColor, unfocusedText: GiniColor, disabledText: GiniColor, errorText: GiniColor, labelFocused: GiniColor, labelUnfocused: GiniColor, labelDisabled: GiniColor, labelError: GiniColor, supportingFocused: GiniColor, supportingUnfocused: GiniColor, supportingDisabled: GiniColor, supportingError: GiniColor, trailingFocused: GiniColor, cursorEnabled: GiniColor, cursorError: GiniColor) { + public init(background: GiniColor, + border: GiniColor, + focusedText: GiniColor, + unfocusedText: GiniColor, + disabledText: GiniColor, + errorText: GiniColor, + labelFocused: GiniColor, + labelUnfocused: GiniColor, + labelDisabled: GiniColor, + labelError: GiniColor, + supportingFocused: GiniColor, + supportingUnfocused: GiniColor, + supportingDisabled: GiniColor, + supportingError: GiniColor, + trailingFocused: GiniColor, + cursorEnabled: GiniColor, + cursorError: GiniColor) { self.background = background self.border = border self.focusedText = focusedText @@ -231,7 +261,10 @@ public struct GiniColorScheme { public var trackOff: GiniColor public var disabledTrack: GiniColor - public init(thumb: GiniColor, trackOn: GiniColor, trackOff: GiniColor, disabledTrack: GiniColor) { + public init(thumb: GiniColor, + trackOn: GiniColor, + trackOff: GiniColor, + disabledTrack: GiniColor) { self.thumb = thumb self.trackOn = trackOn self.trackOff = trackOff @@ -258,7 +291,24 @@ public struct GiniColorScheme { public var textField: TextField public var toggle: Toggle - public init(background: Background, actionSheet: ActionSheet, alert: Alert, navigationBar: NavigationBar, content: Content, bottomBar: BottomBar, container: Container, placeholder: Placeholder, text: Text, icon: Icon, pageController: PageController, error: Error, message: Message, badge: Badge, button: Button, buttonOutlined: ButtonOutlined, textField: TextField, toggle: Toggle) { + public init(background: Background, + actionSheet: ActionSheet, + alert: Alert, + navigationBar: NavigationBar, + content: Content, + bottomBar: BottomBar, + container: Container, + placeholder: Placeholder, + text: Text, + icon: Icon, + pageController: PageController, + error: Error, + message: Message, + badge: Badge, + button: Button, + buttonOutlined: ButtonOutlined, + textField: TextField, + toggle: Toggle) { self.background = background self.actionSheet = actionSheet self.alert = alert From 18e3e37307576770cbd96699068ce152222f2b38 Mon Sep 17 00:00:00 2001 From: Gleb Kulik Date: Wed, 2 Apr 2025 17:02:05 +0200 Subject: [PATCH 026/110] feat(GiniCaptureSDK): GiniCaptureColorScheme PP-1081 --- .../Resources/GiniCaptureColorScheme.swift | 185 ++++++++++++++++++ 1 file changed, 185 insertions(+) create mode 100644 CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Resources/GiniCaptureColorScheme.swift diff --git a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Resources/GiniCaptureColorScheme.swift b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Resources/GiniCaptureColorScheme.swift new file mode 100644 index 0000000000..abb39d41db --- /dev/null +++ b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Resources/GiniCaptureColorScheme.swift @@ -0,0 +1,185 @@ +// +// GiniCaptureColorScheme.swift +// +// Copyright © 2025 Gini GmbH. All rights reserved. +// + +import UIKit +import GiniUtilites + +extension UIColor { + static func giniCaptureColorScheme() -> GiniColorScheme { + return GiniColorScheme( + background: createBackgroundColorScheme(), + actionSheet: createActionSheetColorScheme(), + alert: createAlertColorScheme(), + navigationBar: createNavigationBarColorScheme(), + content: createContentColorScheme(), + bottomBar: createBottomBarColorScheme(), + container: createContainerColorScheme(), + placeholder: createPlaceholderColorScheme(), + text: createTextColorScheme(), + icon: createIconColorScheme(), + pageController: createPageControllerColorScheme(), + error: createErrorColorScheme(), + message: createMessageColorScheme(), + badge: createBadgeColorScheme(), + button: createButtonColorScheme(), + buttonOutlined: createButtonOutlinedColorScheme(), + textField: createTextFieldColorScheme(), + toggle: createToggleColorScheme() + ) + } + + private static func createBackgroundColorScheme() -> GiniColorScheme.Background { + return GiniColorScheme.Background( + primary: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light2, darkModeColor: .GiniCapture.dark2), + secondary: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light1, darkModeColor: .GiniCapture.dark2) + ) + } + + private static func createActionSheetColorScheme() -> GiniColorScheme.ActionSheet { + return GiniColorScheme.ActionSheet( + buttonBackground: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light1.withAlphaComponent(0.72), darkModeColor: .GiniCapture.dark5.withAlphaComponent(0.5)), + cancelButtonBackground: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light1, darkModeColor: .GiniCapture.dark3) + ) + } + + private static func createAlertColorScheme() -> GiniColorScheme.Alert { + return GiniColorScheme.Alert( + background: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light2.withAlphaComponent(0.8), darkModeColor: .GiniCapture.dark3.withAlphaComponent(0.8)), + divider: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light6, darkModeColor: .GiniCapture.dark4.withAlphaComponent(0.65)) + ) + } + + private static func createNavigationBarColorScheme() -> GiniColorScheme.NavigationBar { + return GiniColorScheme.NavigationBar( + background: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light2, darkModeColor: .GiniCapture.dark2), + action: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.accent1, darkModeColor: .GiniCapture.accent1), + navigation: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.accent1, darkModeColor: .GiniCapture.accent1) + ) + } + + private static func createContentColorScheme() -> GiniColorScheme.Content { + return GiniColorScheme.Content( + navigation: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.accent1, darkModeColor: .GiniCapture.accent1), + text: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light1, darkModeColor: .GiniCapture.light1) + ) + } + + private static func createBottomBarColorScheme() -> GiniColorScheme.BottomBar { + return GiniColorScheme.BottomBar( + background: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light1, darkModeColor: .GiniCapture.dark3), + border: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light3, darkModeColor: .GiniCapture.dark4) + ) + } + + private static func createContainerColorScheme() -> GiniColorScheme.Container { + return GiniColorScheme.Container( + background: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light1, darkModeColor: .GiniCapture.dark3) + ) + } + + private static func createPlaceholderColorScheme() -> GiniColorScheme.Placeholder { + return GiniColorScheme.Placeholder( + background: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light2, darkModeColor: .GiniCapture.dark4), + tint: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark7, darkModeColor: .GiniCapture.light6) + ) + } + + private static func createTextColorScheme() -> GiniColorScheme.Text { + return GiniColorScheme.Text( + primary: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark1, darkModeColor: .GiniCapture.light1), + secondary: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark6, darkModeColor: .GiniCapture.dark7), + tertiary: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark7, darkModeColor: .GiniCapture.dark7), + accent: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.accent1, darkModeColor: .GiniCapture.accent1), + success: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.success3, darkModeColor: .GiniCapture.success3), + error: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.error3, darkModeColor: .GiniCapture.error3) + ) + } + + private static func createIconColorScheme() -> GiniColorScheme.Icon { + return GiniColorScheme.Icon( + primary: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark2, darkModeColor: .GiniCapture.light1), + secondary: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light4, darkModeColor: .GiniCapture.dark6) + ) + } + + private static func createPageControllerColorScheme() -> GiniColorScheme.PageController { + return GiniColorScheme.PageController( + selected: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark1, darkModeColor: .GiniCapture.light1), + unselected: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark1.withAlphaComponent(0.3), darkModeColor: .GiniCapture.light1.withAlphaComponent(0.3)) + ) + } + + private static func createErrorColorScheme() -> GiniColorScheme.Error { + return GiniColorScheme.Error( + background: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.error4, darkModeColor: .GiniCapture.error4), + icon: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.error3, darkModeColor: .GiniCapture.error3) + ) + } + + private static func createMessageColorScheme() -> GiniColorScheme.Message { + return GiniColorScheme.Message( + backgroundSuccess: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.success5, darkModeColor: .GiniCapture.success5), + contentSuccess: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.success2, darkModeColor: .GiniCapture.success2), + backgroundWarning: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.warning5, darkModeColor: .GiniCapture.warning5), + contentWarning: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.warning2, darkModeColor: .GiniCapture.warning2), + backgroundError: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.error5, darkModeColor: .GiniCapture.error5), + contentError: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.error2, darkModeColor: .GiniCapture.error2) + ) + } + + private static func createBadgeColorScheme() -> GiniColorScheme.Badge { + return GiniColorScheme.Badge( + background: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.success3, darkModeColor: .GiniCapture.success3), + content: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light1, darkModeColor: .GiniCapture.light1) + ) + } + + private static func createButtonColorScheme() -> GiniColorScheme.Button { + return GiniColorScheme.Button( + background: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.accent1, darkModeColor: .GiniCapture.accent1), + backgroundLoading: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.accent1.withAlphaComponent(0.24), darkModeColor: .GiniCapture.accent1.withAlphaComponent(0.24)), + content: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light1, darkModeColor: .GiniCapture.light1) + ) + } + + private static func createButtonOutlinedColorScheme() -> GiniColorScheme.ButtonOutlined { + return GiniColorScheme.ButtonOutlined( + background: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light4, darkModeColor: .GiniCapture.dark4), + content: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark6, darkModeColor: .GiniCapture.light6) + ) + } + + private static func createTextFieldColorScheme() -> GiniColorScheme.TextField { + return GiniColorScheme.TextField( + background: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light1, darkModeColor: .GiniCapture.dark3), + border: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light3, darkModeColor: .GiniCapture.dark4), + focusedText: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark2, darkModeColor: .GiniCapture.light1), + unfocusedText: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark2, darkModeColor: .GiniCapture.light1), + disabledText: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark2, darkModeColor: .GiniCapture.light1), + errorText: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.error3, darkModeColor: .GiniCapture.error3), + labelFocused: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark6, darkModeColor: .GiniCapture.dark6), + labelUnfocused: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark6, darkModeColor: .GiniCapture.dark6), + labelDisabled: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark6, darkModeColor: .GiniCapture.dark6), + labelError: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.error3, darkModeColor: .GiniCapture.error3), + supportingFocused: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark6, darkModeColor: .GiniCapture.dark6), + supportingUnfocused: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark6, darkModeColor: .GiniCapture.dark6), + supportingDisabled: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark6, darkModeColor: .GiniCapture.dark6), + supportingError: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.error3, darkModeColor: .GiniCapture.error3), + trailingFocused: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark7, darkModeColor: .GiniCapture.light6), + cursorEnabled: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.accent1, darkModeColor: .GiniCapture.accent1), + cursorError: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.error3, darkModeColor: .GiniCapture.error3) + ) + } + + private static func createToggleColorScheme() -> GiniColorScheme.Toggle { + return GiniColorScheme.Toggle( + thumb: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light1, darkModeColor: .GiniCapture.light1), + trackOn: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.accent1, darkModeColor: .GiniCapture.accent1), + trackOff: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light4, darkModeColor: .GiniCapture.dark4), + disabledTrack: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light4, darkModeColor: .GiniCapture.dark4) + ) + } +} From 9c0d9d3801d1c7a3ef131a6d030f54da23d7b76d Mon Sep 17 00:00:00 2001 From: Gleb Kulik Date: Thu, 3 Apr 2025 11:20:35 +0200 Subject: [PATCH 027/110] feat(GiniCaptureSDK): GiniCaptureColorScheme add "Capture" prefix PP-1081 --- .../Resources/GiniCaptureColorScheme.swift | 78 +++++++++---------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Resources/GiniCaptureColorScheme.swift b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Resources/GiniCaptureColorScheme.swift index abb39d41db..b91205bdf6 100644 --- a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Resources/GiniCaptureColorScheme.swift +++ b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Resources/GiniCaptureColorScheme.swift @@ -10,49 +10,49 @@ import GiniUtilites extension UIColor { static func giniCaptureColorScheme() -> GiniColorScheme { return GiniColorScheme( - background: createBackgroundColorScheme(), - actionSheet: createActionSheetColorScheme(), - alert: createAlertColorScheme(), - navigationBar: createNavigationBarColorScheme(), - content: createContentColorScheme(), - bottomBar: createBottomBarColorScheme(), - container: createContainerColorScheme(), - placeholder: createPlaceholderColorScheme(), - text: createTextColorScheme(), - icon: createIconColorScheme(), - pageController: createPageControllerColorScheme(), - error: createErrorColorScheme(), - message: createMessageColorScheme(), - badge: createBadgeColorScheme(), - button: createButtonColorScheme(), - buttonOutlined: createButtonOutlinedColorScheme(), - textField: createTextFieldColorScheme(), - toggle: createToggleColorScheme() - ) - } - - private static func createBackgroundColorScheme() -> GiniColorScheme.Background { + background: createCaptureBackgroundColorScheme(), + actionSheet: createCaptureActionSheetColorScheme(), + alert: createCaptureAlertColorScheme(), + navigationBar: createCaptureNavigationBarColorScheme(), + content: createCaptureContentColorScheme(), + bottomBar: createCaptureBottomBarColorScheme(), + container: createCaptureContainerColorScheme(), + placeholder: createCapturePlaceholderColorScheme(), + text: createCaptureTextColorScheme(), + icon: createCaptureIconColorScheme(), + pageController: createCapturePageControllerColorScheme(), + error: createCaptureErrorColorScheme(), + message: createCaptureMessageColorScheme(), + badge: createCaptureBadgeColorScheme(), + button: createCaptureButtonColorScheme(), + buttonOutlined: createCaptureButtonOutlinedColorScheme(), + textField: createCaptureTextFieldColorScheme(), + toggle: createCaptureToggleColorScheme() + ) + } + + private static func createCaptureBackgroundColorScheme() -> GiniColorScheme.Background { return GiniColorScheme.Background( primary: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light2, darkModeColor: .GiniCapture.dark2), secondary: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light1, darkModeColor: .GiniCapture.dark2) ) } - private static func createActionSheetColorScheme() -> GiniColorScheme.ActionSheet { + private static func createCaptureActionSheetColorScheme() -> GiniColorScheme.ActionSheet { return GiniColorScheme.ActionSheet( buttonBackground: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light1.withAlphaComponent(0.72), darkModeColor: .GiniCapture.dark5.withAlphaComponent(0.5)), cancelButtonBackground: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light1, darkModeColor: .GiniCapture.dark3) ) } - private static func createAlertColorScheme() -> GiniColorScheme.Alert { + private static func createCaptureAlertColorScheme() -> GiniColorScheme.Alert { return GiniColorScheme.Alert( background: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light2.withAlphaComponent(0.8), darkModeColor: .GiniCapture.dark3.withAlphaComponent(0.8)), divider: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light6, darkModeColor: .GiniCapture.dark4.withAlphaComponent(0.65)) ) } - private static func createNavigationBarColorScheme() -> GiniColorScheme.NavigationBar { + private static func createCaptureNavigationBarColorScheme() -> GiniColorScheme.NavigationBar { return GiniColorScheme.NavigationBar( background: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light2, darkModeColor: .GiniCapture.dark2), action: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.accent1, darkModeColor: .GiniCapture.accent1), @@ -60,34 +60,34 @@ extension UIColor { ) } - private static func createContentColorScheme() -> GiniColorScheme.Content { + private static func createCaptureContentColorScheme() -> GiniColorScheme.Content { return GiniColorScheme.Content( navigation: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.accent1, darkModeColor: .GiniCapture.accent1), text: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light1, darkModeColor: .GiniCapture.light1) ) } - private static func createBottomBarColorScheme() -> GiniColorScheme.BottomBar { + private static func createCaptureBottomBarColorScheme() -> GiniColorScheme.BottomBar { return GiniColorScheme.BottomBar( background: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light1, darkModeColor: .GiniCapture.dark3), border: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light3, darkModeColor: .GiniCapture.dark4) ) } - private static func createContainerColorScheme() -> GiniColorScheme.Container { + private static func createCaptureContainerColorScheme() -> GiniColorScheme.Container { return GiniColorScheme.Container( background: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light1, darkModeColor: .GiniCapture.dark3) ) } - private static func createPlaceholderColorScheme() -> GiniColorScheme.Placeholder { + private static func createCapturePlaceholderColorScheme() -> GiniColorScheme.Placeholder { return GiniColorScheme.Placeholder( background: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light2, darkModeColor: .GiniCapture.dark4), tint: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark7, darkModeColor: .GiniCapture.light6) ) } - private static func createTextColorScheme() -> GiniColorScheme.Text { + private static func createCaptureTextColorScheme() -> GiniColorScheme.Text { return GiniColorScheme.Text( primary: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark1, darkModeColor: .GiniCapture.light1), secondary: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark6, darkModeColor: .GiniCapture.dark7), @@ -98,28 +98,28 @@ extension UIColor { ) } - private static func createIconColorScheme() -> GiniColorScheme.Icon { + private static func createCaptureIconColorScheme() -> GiniColorScheme.Icon { return GiniColorScheme.Icon( primary: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark2, darkModeColor: .GiniCapture.light1), secondary: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light4, darkModeColor: .GiniCapture.dark6) ) } - private static func createPageControllerColorScheme() -> GiniColorScheme.PageController { + private static func createCapturePageControllerColorScheme() -> GiniColorScheme.PageController { return GiniColorScheme.PageController( selected: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark1, darkModeColor: .GiniCapture.light1), unselected: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark1.withAlphaComponent(0.3), darkModeColor: .GiniCapture.light1.withAlphaComponent(0.3)) ) } - private static func createErrorColorScheme() -> GiniColorScheme.Error { + private static func createCaptureErrorColorScheme() -> GiniColorScheme.Error { return GiniColorScheme.Error( background: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.error4, darkModeColor: .GiniCapture.error4), icon: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.error3, darkModeColor: .GiniCapture.error3) ) } - private static func createMessageColorScheme() -> GiniColorScheme.Message { + private static func createCaptureMessageColorScheme() -> GiniColorScheme.Message { return GiniColorScheme.Message( backgroundSuccess: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.success5, darkModeColor: .GiniCapture.success5), contentSuccess: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.success2, darkModeColor: .GiniCapture.success2), @@ -130,14 +130,14 @@ extension UIColor { ) } - private static func createBadgeColorScheme() -> GiniColorScheme.Badge { + private static func createCaptureBadgeColorScheme() -> GiniColorScheme.Badge { return GiniColorScheme.Badge( background: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.success3, darkModeColor: .GiniCapture.success3), content: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light1, darkModeColor: .GiniCapture.light1) ) } - private static func createButtonColorScheme() -> GiniColorScheme.Button { + private static func createCaptureButtonColorScheme() -> GiniColorScheme.Button { return GiniColorScheme.Button( background: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.accent1, darkModeColor: .GiniCapture.accent1), backgroundLoading: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.accent1.withAlphaComponent(0.24), darkModeColor: .GiniCapture.accent1.withAlphaComponent(0.24)), @@ -145,14 +145,14 @@ extension UIColor { ) } - private static func createButtonOutlinedColorScheme() -> GiniColorScheme.ButtonOutlined { + private static func createCaptureButtonOutlinedColorScheme() -> GiniColorScheme.ButtonOutlined { return GiniColorScheme.ButtonOutlined( background: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light4, darkModeColor: .GiniCapture.dark4), content: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark6, darkModeColor: .GiniCapture.light6) ) } - private static func createTextFieldColorScheme() -> GiniColorScheme.TextField { + private static func createCaptureTextFieldColorScheme() -> GiniColorScheme.TextField { return GiniColorScheme.TextField( background: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light1, darkModeColor: .GiniCapture.dark3), border: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light3, darkModeColor: .GiniCapture.dark4), @@ -174,7 +174,7 @@ extension UIColor { ) } - private static func createToggleColorScheme() -> GiniColorScheme.Toggle { + private static func createCaptureToggleColorScheme() -> GiniColorScheme.Toggle { return GiniColorScheme.Toggle( thumb: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light1, darkModeColor: .GiniCapture.light1), trackOn: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.accent1, darkModeColor: .GiniCapture.accent1), From 11a9be1955f958335d5d74e84b2abbdacd607089 Mon Sep 17 00:00:00 2001 From: Valentina Iancu Date: Tue, 8 Apr 2025 11:24:50 +0200 Subject: [PATCH 028/110] fix(GiniBankAPILibrary): Update jazzy file PP-1079 --- BankAPILibrary/GiniBankAPILibrary/.jazzy.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/BankAPILibrary/GiniBankAPILibrary/.jazzy.yaml b/BankAPILibrary/GiniBankAPILibrary/.jazzy.yaml index ff8f7d2a41..56e3ff2d7c 100644 --- a/BankAPILibrary/GiniBankAPILibrary/.jazzy.yaml +++ b/BankAPILibrary/GiniBankAPILibrary/.jazzy.yaml @@ -4,6 +4,8 @@ xcodebuild_arguments: - GiniMobile.xcworkspace - "-scheme" - GiniBankAPILibrary +- "-destination" +- platform=iOS Simulator,OS=17.5,name=iPhone 15 author: Gini GmbH author_url: https://gini.net module: GiniBankAPILibrary From 7df24b9b293d19bbdb2d4e656fec20454b6dd518 Mon Sep 17 00:00:00 2001 From: Gleb Kulik Date: Tue, 29 Apr 2025 17:47:26 +0200 Subject: [PATCH 029/110] feat(GiniCaptureSDK): remove GiniCaptureColorScheme PP-1081 --- .../Resources/GiniCaptureColorScheme.swift | 185 ------------------ 1 file changed, 185 deletions(-) delete mode 100644 CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Resources/GiniCaptureColorScheme.swift diff --git a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Resources/GiniCaptureColorScheme.swift b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Resources/GiniCaptureColorScheme.swift deleted file mode 100644 index b91205bdf6..0000000000 --- a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Resources/GiniCaptureColorScheme.swift +++ /dev/null @@ -1,185 +0,0 @@ -// -// GiniCaptureColorScheme.swift -// -// Copyright © 2025 Gini GmbH. All rights reserved. -// - -import UIKit -import GiniUtilites - -extension UIColor { - static func giniCaptureColorScheme() -> GiniColorScheme { - return GiniColorScheme( - background: createCaptureBackgroundColorScheme(), - actionSheet: createCaptureActionSheetColorScheme(), - alert: createCaptureAlertColorScheme(), - navigationBar: createCaptureNavigationBarColorScheme(), - content: createCaptureContentColorScheme(), - bottomBar: createCaptureBottomBarColorScheme(), - container: createCaptureContainerColorScheme(), - placeholder: createCapturePlaceholderColorScheme(), - text: createCaptureTextColorScheme(), - icon: createCaptureIconColorScheme(), - pageController: createCapturePageControllerColorScheme(), - error: createCaptureErrorColorScheme(), - message: createCaptureMessageColorScheme(), - badge: createCaptureBadgeColorScheme(), - button: createCaptureButtonColorScheme(), - buttonOutlined: createCaptureButtonOutlinedColorScheme(), - textField: createCaptureTextFieldColorScheme(), - toggle: createCaptureToggleColorScheme() - ) - } - - private static func createCaptureBackgroundColorScheme() -> GiniColorScheme.Background { - return GiniColorScheme.Background( - primary: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light2, darkModeColor: .GiniCapture.dark2), - secondary: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light1, darkModeColor: .GiniCapture.dark2) - ) - } - - private static func createCaptureActionSheetColorScheme() -> GiniColorScheme.ActionSheet { - return GiniColorScheme.ActionSheet( - buttonBackground: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light1.withAlphaComponent(0.72), darkModeColor: .GiniCapture.dark5.withAlphaComponent(0.5)), - cancelButtonBackground: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light1, darkModeColor: .GiniCapture.dark3) - ) - } - - private static func createCaptureAlertColorScheme() -> GiniColorScheme.Alert { - return GiniColorScheme.Alert( - background: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light2.withAlphaComponent(0.8), darkModeColor: .GiniCapture.dark3.withAlphaComponent(0.8)), - divider: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light6, darkModeColor: .GiniCapture.dark4.withAlphaComponent(0.65)) - ) - } - - private static func createCaptureNavigationBarColorScheme() -> GiniColorScheme.NavigationBar { - return GiniColorScheme.NavigationBar( - background: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light2, darkModeColor: .GiniCapture.dark2), - action: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.accent1, darkModeColor: .GiniCapture.accent1), - navigation: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.accent1, darkModeColor: .GiniCapture.accent1) - ) - } - - private static func createCaptureContentColorScheme() -> GiniColorScheme.Content { - return GiniColorScheme.Content( - navigation: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.accent1, darkModeColor: .GiniCapture.accent1), - text: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light1, darkModeColor: .GiniCapture.light1) - ) - } - - private static func createCaptureBottomBarColorScheme() -> GiniColorScheme.BottomBar { - return GiniColorScheme.BottomBar( - background: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light1, darkModeColor: .GiniCapture.dark3), - border: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light3, darkModeColor: .GiniCapture.dark4) - ) - } - - private static func createCaptureContainerColorScheme() -> GiniColorScheme.Container { - return GiniColorScheme.Container( - background: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light1, darkModeColor: .GiniCapture.dark3) - ) - } - - private static func createCapturePlaceholderColorScheme() -> GiniColorScheme.Placeholder { - return GiniColorScheme.Placeholder( - background: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light2, darkModeColor: .GiniCapture.dark4), - tint: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark7, darkModeColor: .GiniCapture.light6) - ) - } - - private static func createCaptureTextColorScheme() -> GiniColorScheme.Text { - return GiniColorScheme.Text( - primary: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark1, darkModeColor: .GiniCapture.light1), - secondary: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark6, darkModeColor: .GiniCapture.dark7), - tertiary: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark7, darkModeColor: .GiniCapture.dark7), - accent: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.accent1, darkModeColor: .GiniCapture.accent1), - success: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.success3, darkModeColor: .GiniCapture.success3), - error: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.error3, darkModeColor: .GiniCapture.error3) - ) - } - - private static func createCaptureIconColorScheme() -> GiniColorScheme.Icon { - return GiniColorScheme.Icon( - primary: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark2, darkModeColor: .GiniCapture.light1), - secondary: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light4, darkModeColor: .GiniCapture.dark6) - ) - } - - private static func createCapturePageControllerColorScheme() -> GiniColorScheme.PageController { - return GiniColorScheme.PageController( - selected: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark1, darkModeColor: .GiniCapture.light1), - unselected: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark1.withAlphaComponent(0.3), darkModeColor: .GiniCapture.light1.withAlphaComponent(0.3)) - ) - } - - private static func createCaptureErrorColorScheme() -> GiniColorScheme.Error { - return GiniColorScheme.Error( - background: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.error4, darkModeColor: .GiniCapture.error4), - icon: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.error3, darkModeColor: .GiniCapture.error3) - ) - } - - private static func createCaptureMessageColorScheme() -> GiniColorScheme.Message { - return GiniColorScheme.Message( - backgroundSuccess: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.success5, darkModeColor: .GiniCapture.success5), - contentSuccess: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.success2, darkModeColor: .GiniCapture.success2), - backgroundWarning: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.warning5, darkModeColor: .GiniCapture.warning5), - contentWarning: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.warning2, darkModeColor: .GiniCapture.warning2), - backgroundError: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.error5, darkModeColor: .GiniCapture.error5), - contentError: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.error2, darkModeColor: .GiniCapture.error2) - ) - } - - private static func createCaptureBadgeColorScheme() -> GiniColorScheme.Badge { - return GiniColorScheme.Badge( - background: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.success3, darkModeColor: .GiniCapture.success3), - content: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light1, darkModeColor: .GiniCapture.light1) - ) - } - - private static func createCaptureButtonColorScheme() -> GiniColorScheme.Button { - return GiniColorScheme.Button( - background: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.accent1, darkModeColor: .GiniCapture.accent1), - backgroundLoading: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.accent1.withAlphaComponent(0.24), darkModeColor: .GiniCapture.accent1.withAlphaComponent(0.24)), - content: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light1, darkModeColor: .GiniCapture.light1) - ) - } - - private static func createCaptureButtonOutlinedColorScheme() -> GiniColorScheme.ButtonOutlined { - return GiniColorScheme.ButtonOutlined( - background: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light4, darkModeColor: .GiniCapture.dark4), - content: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark6, darkModeColor: .GiniCapture.light6) - ) - } - - private static func createCaptureTextFieldColorScheme() -> GiniColorScheme.TextField { - return GiniColorScheme.TextField( - background: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light1, darkModeColor: .GiniCapture.dark3), - border: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light3, darkModeColor: .GiniCapture.dark4), - focusedText: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark2, darkModeColor: .GiniCapture.light1), - unfocusedText: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark2, darkModeColor: .GiniCapture.light1), - disabledText: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark2, darkModeColor: .GiniCapture.light1), - errorText: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.error3, darkModeColor: .GiniCapture.error3), - labelFocused: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark6, darkModeColor: .GiniCapture.dark6), - labelUnfocused: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark6, darkModeColor: .GiniCapture.dark6), - labelDisabled: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark6, darkModeColor: .GiniCapture.dark6), - labelError: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.error3, darkModeColor: .GiniCapture.error3), - supportingFocused: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark6, darkModeColor: .GiniCapture.dark6), - supportingUnfocused: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark6, darkModeColor: .GiniCapture.dark6), - supportingDisabled: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark6, darkModeColor: .GiniCapture.dark6), - supportingError: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.error3, darkModeColor: .GiniCapture.error3), - trailingFocused: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.dark7, darkModeColor: .GiniCapture.light6), - cursorEnabled: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.accent1, darkModeColor: .GiniCapture.accent1), - cursorError: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.error3, darkModeColor: .GiniCapture.error3) - ) - } - - private static func createCaptureToggleColorScheme() -> GiniColorScheme.Toggle { - return GiniColorScheme.Toggle( - thumb: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light1, darkModeColor: .GiniCapture.light1), - trackOn: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.accent1, darkModeColor: .GiniCapture.accent1), - trackOff: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light4, darkModeColor: .GiniCapture.dark4), - disabledTrack: GiniUtilites.GiniColor(lightModeColor: .GiniCapture.light4, darkModeColor: .GiniCapture.dark4) - ) - } -} From 461aeca04753d7b42efc8bc52ac613f1fae13572 Mon Sep 17 00:00:00 2001 From: Gleb Kulik Date: Tue, 29 Apr 2025 18:00:49 +0200 Subject: [PATCH 030/110] feat(GiniBankSDKPinningExample): import GiniUtilites to GiniBankAPILibraryPinningIntegrationTests PP-1081 --- .../GiniBankAPILibraryPinningIntegrationTests.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/BankSDK/GiniBankSDKPinningExample/Tests/BankAPILibraryPinning/GiniBankAPILibraryPinningIntegrationTests.swift b/BankSDK/GiniBankSDKPinningExample/Tests/BankAPILibraryPinning/GiniBankAPILibraryPinningIntegrationTests.swift index 61c50d6483..e8ba1f44a0 100644 --- a/BankSDK/GiniBankSDKPinningExample/Tests/BankAPILibraryPinning/GiniBankAPILibraryPinningIntegrationTests.swift +++ b/BankSDK/GiniBankSDKPinningExample/Tests/BankAPILibraryPinning/GiniBankAPILibraryPinningIntegrationTests.swift @@ -8,6 +8,7 @@ import XCTest @testable import GiniCaptureSDK @testable import GiniBankAPILibrary @testable import TrustKit +@testable import GiniUtilites class GiniBankAPILibraryPinningIntegrationTests: XCTestCase { From 8cc16ac359e1f433aa004295b673add3af105ffa Mon Sep 17 00:00:00 2001 From: Gleb Kulik Date: Tue, 29 Apr 2025 18:17:19 +0200 Subject: [PATCH 031/110] feat(GiniBankSDKExample): import GiniUtilites to BankAPILibraryIntegrationTests PP-1081 --- .../BankAPILibrary/BankAPILibraryIntegrationTests.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/BankSDK/GiniBankSDKExample/Tests/IntegrationTests/BankAPILibrary/BankAPILibraryIntegrationTests.swift b/BankSDK/GiniBankSDKExample/Tests/IntegrationTests/BankAPILibrary/BankAPILibraryIntegrationTests.swift index c1820725d8..6b7b8c33a3 100644 --- a/BankSDK/GiniBankSDKExample/Tests/IntegrationTests/BankAPILibrary/BankAPILibraryIntegrationTests.swift +++ b/BankSDK/GiniBankSDKExample/Tests/IntegrationTests/BankAPILibrary/BankAPILibraryIntegrationTests.swift @@ -9,6 +9,7 @@ import Foundation import XCTest @testable import GiniCaptureSDK @testable import GiniBankAPILibrary +@testable import GiniUtilites class BankAPILibraryIntegrationTests: BaseIntegrationTest { // In cases tests are failing please check if the `paymentRequestID` is still valid From a1d9b459b2cafac382ddd12f69d01f41f5942782 Mon Sep 17 00:00:00 2001 From: Valentina Iancu Date: Mon, 30 Jun 2025 19:34:59 +0200 Subject: [PATCH 032/110] feat(GiniCaptureSDK): Revert the removal of the deprecated method `cleanup` --- .../Core/GiniConfiguration.swift | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/GiniConfiguration.swift b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/GiniConfiguration.swift index f118196f66..3b5e670244 100644 --- a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/GiniConfiguration.swift +++ b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/GiniConfiguration.swift @@ -469,6 +469,38 @@ import GiniBankAPILibrary var documentService: DocumentServiceProtocol? + // swiftlint:disable function_parameter_count + /// Function for clean up + /// - Parameters: + /// - paymentRecipient: paymentRecipient description + /// - paymentReference: paymentReference description + /// - iban: iban description + /// - bic: bic description + /// - amountToPay: amountToPay description + // swiftlint:disable line_length + @available(*, deprecated, message: "Please use sendTransferSummary() to provide the required transfer summary first (if the user has completed TAN verification) and then cleanup() to let the SDK free up used resources") + // swiftlint:enable line_length + public func cleanup(paymentRecipient: String, + paymentReference: String, + paymentPurpose: String, + iban: String, + bic: String, + amountToPay: ExtractionAmount) { + guard let documentService = documentService else { return } + + let updatedExtractions = buildPaymentExtractions(paymentRecipient, + paymentReference, + paymentPurpose, + iban, + bic, + amountToPay) + + documentService.sendFeedback(with: updatedExtractions, updatedCompoundExtractions: nil) + + documentService.resetToInitialState() + self.documentService = nil + } + private func buildPaymentExtractions(_ paymentRecipient: String, _ paymentReference: String, _ paymentPurpose: String, From cb12fcbb6971cb71e7412e812fa93c98cd40a9b2 Mon Sep 17 00:00:00 2001 From: Valentina Iancu Date: Mon, 30 Jun 2025 19:35:14 +0200 Subject: [PATCH 033/110] feat(GiniBankSDK): Revert the removal of the deprecated method `cleanup` --- .../Core/GiniBankConfiguration.swift | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/GiniBankConfiguration.swift b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/GiniBankConfiguration.swift index a2921371d6..8d1ba81fa7 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/GiniBankConfiguration.swift +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/GiniBankConfiguration.swift @@ -542,7 +542,49 @@ public final class GiniBankConfiguration: NSObject { } // MARK: - Transfer summary sending and cleanup + // Deprecated method - Please use sendTransferSummary() + /** + Function for clean up + - Parameters: + - paymentRecipient: paymentRecipient description + - paymentReference: paymentReference description + - iban: iban description + - bic: bic description + - amountToPay: amountToPay description + */ + + // swiftlint:disable line_length + @available(*, deprecated, message: "Please use sendTransferSummary() to provide the required transfer summary first (if the user has completed TAN verification) and then cleanup() to let the SDK free up used resources") + // swiftlint:enable line_length + // swiftlint:disable function_parameter_count + // swiftlint:disable function_body_length + public func cleanup(paymentRecipient: String, + paymentReference: String, + paymentPurpose: String, + iban: String, + bic: String, + amountToPay: ExtractionAmount) { + guard let documentService = documentService else { return } + + let updatedExtractions = generateBasicExtractions(paymentRecipient: paymentRecipient, + paymentReference: paymentReference, + paymentPurpose: paymentPurpose, + iban: iban, + bic: bic, + amountToPayString: amountToPay.formattedString()) + + if let lineItems = lineItems { + documentService.sendFeedback(with: updatedExtractions, + updatedCompoundExtractions: ["lineItems": lineItems]) + } else { + documentService.sendFeedback(with: updatedExtractions, + updatedCompoundExtractions: nil) + } + documentService.resetToInitialState() + self.documentService = nil + self.lineItems = nil + } // swiftlint:enable function_body_length // swiftlint:enable function_parameter_count From bb2619c0e96c42104cbb0359eb073641aa9055d2 Mon Sep 17 00:00:00 2001 From: Valentina Iancu Date: Tue, 1 Jul 2025 11:33:12 +0200 Subject: [PATCH 034/110] ci: Add `GiniUtilities` dependency for XCFramework generation script --- .github/workflows/bank-sdk.build.xcframeworks.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/bank-sdk.build.xcframeworks.yml b/.github/workflows/bank-sdk.build.xcframeworks.yml index e0e25327b6..d82c8372b8 100644 --- a/.github/workflows/bank-sdk.build.xcframeworks.yml +++ b/.github/workflows/bank-sdk.build.xcframeworks.yml @@ -93,6 +93,11 @@ jobs: - name: Generate XCFrameworks run: | + xcodebuild -create-xcframework \ + -framework iphoneosPinning.xcarchive/Products/Library/Frameworks/GiniUtilites.framework \ + -framework iphonesimulatorPinning.xcarchive/Products/Library/Frameworks/GiniUtilites.framework \ + -output GiniUtilites.xcframework &&\ + \ xcodebuild -create-xcframework \ -framework iphoneosPinning.xcarchive/Products/Library/Frameworks/GiniBankAPILibrary.framework \ -framework iphonesimulatorPinning.xcarchive/Products/Library/Frameworks/GiniBankAPILibrary.framework \ @@ -163,6 +168,7 @@ jobs: cp $PP_PATH2 ~/Library/MobileDevice/Provisioning\ Profiles # sign xcframeworks + codesign --timestamp -v --sign "Apple Distribution: Gini GmbH (JA825X8F7Z)" GiniUtilites.xcframework && \ codesign --timestamp -v --sign "Apple Distribution: Gini GmbH (JA825X8F7Z)" GiniBankAPILibrary.xcframework && \ codesign --timestamp -v --sign "Apple Distribution: Gini GmbH (JA825X8F7Z)" GiniCaptureSDK.xcframework && \ codesign --timestamp -v --sign "Apple Distribution: Gini GmbH (JA825X8F7Z)" GiniBankSDK.xcframework && \ @@ -175,6 +181,7 @@ jobs: with: name: GiniBankSDKFramework path: | + GiniUtilites.xcframework GiniBankAPILibrary.xcframework GiniBankSDK.xcframework GiniCaptureSDK.xcframework From 0f3545bbe866d38df840fc6f3ea40e2830236a11 Mon Sep 17 00:00:00 2001 From: Valentina Iancu Date: Tue, 1 Jul 2025 17:15:47 +0200 Subject: [PATCH 035/110] feat(GiniUtilites): Introduce `GiniUserDefault` a property wrapper for storing and retrieving `Codable` values in `UserDefaults` PP-1222 --- .../GiniUserDefaultPropertyWrapper.swift | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 GiniComponents/GiniUtilites/Sources/GiniUtilites/Storage/GiniUserDefaultPropertyWrapper.swift diff --git a/GiniComponents/GiniUtilites/Sources/GiniUtilites/Storage/GiniUserDefaultPropertyWrapper.swift b/GiniComponents/GiniUtilites/Sources/GiniUtilites/Storage/GiniUserDefaultPropertyWrapper.swift new file mode 100644 index 0000000000..0fbbf07f18 --- /dev/null +++ b/GiniComponents/GiniUtilites/Sources/GiniUtilites/Storage/GiniUserDefaultPropertyWrapper.swift @@ -0,0 +1,58 @@ +// +// GiniUserDefaultPropertyWrapper.swift +// +// Copyright © 2024 Gini GmbH. All rights reserved. +// + + +import Foundation +/** + A property wrapper for storing and retrieving `Codable` values in `UserDefaults`. + + This wrapper automatically encodes and decodes the wrapped value using `JSONEncoder` and `JSONDecoder`. +*/ + +@propertyWrapper +public struct GiniUserDefault { + // The key used to store the value in `UserDefaults`. + let key: String + // The default value returned if no value is found for the given key. + let defaultValue: T + + /** + Initializes the property wrapper. + + - Parameters: + - key: The `UserDefaults` key. + - defaultValue: A fallback value to return if no data is stored. + */ + public init(_ key: String, defaultValue: T) { + self.key = key + self.defaultValue = defaultValue + } + + /** + The wrapped value that can be accessed or modified. + + - Returns: The decoded value from `UserDefaults` if present and valid, otherwise the default value. + - Sets: The value is encoded and stored in `UserDefaults`. + */ + public var wrappedValue: T { + get { + // Handle Codable types with JSON encoding/decoding + if let data = UserDefaults.standard.data(forKey: key), + let decodedValue = try? JSONDecoder().decode(T.self, from: data) { + return decodedValue + } + return defaultValue + } + set { + // Handle Codable types with JSON encoding + if let encodedValue = try? JSONEncoder().encode(newValue) { + UserDefaults.standard.set(encodedValue, forKey: key) + } else { + UserDefaults.standard.set(newValue, forKey: key) + } + } + } +} From 3c372f15b48028904db1a1bbc62d7f9b5dd8fedf Mon Sep 17 00:00:00 2001 From: Valentina Iancu Date: Tue, 1 Jul 2025 17:17:04 +0200 Subject: [PATCH 036/110] refactor(GiniCaptureSDK): Remove `GiniCaptureUserDefault` PP-1222 --- ...iniCaptureUserDefaultPropertyWrapper.swift | 42 ------------------- 1 file changed, 42 deletions(-) delete mode 100644 CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Storage/GiniCaptureUserDefaultPropertyWrapper.swift diff --git a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Storage/GiniCaptureUserDefaultPropertyWrapper.swift b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Storage/GiniCaptureUserDefaultPropertyWrapper.swift deleted file mode 100644 index 632fccf9d4..0000000000 --- a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Storage/GiniCaptureUserDefaultPropertyWrapper.swift +++ /dev/null @@ -1,42 +0,0 @@ -// -// GiniCaptureUserDefaultPropertyWrapper.swift -// -// Copyright © 2025 Gini GmbH. All rights reserved. -// - -import Foundation - -/** - This is for internal use only. - This is a property wrapper for managing UserDefaults storage. It allows for easy encoding and decoding of Codable types. - */ - -@propertyWrapper -public struct GiniCaptureUserDefault { - let key: String - let defaultValue: T - - init(_ key: String, defaultValue: T) { - self.key = key - self.defaultValue = defaultValue - } - - public var wrappedValue: T { - get { - // Handle Codable types with JSON encoding/decoding - if let data = UserDefaults.standard.data(forKey: key), - let decodedValue = try? JSONDecoder().decode(T.self, from: data) { - return decodedValue - } - return defaultValue - } - set { - // Handle Codable types with JSON encoding - if let encodedValue = try? JSONEncoder().encode(newValue) { - UserDefaults.standard.set(encodedValue, forKey: key) - } else { - UserDefaults.standard.set(newValue, forKey: key) - } - } - } -} From c69ad56a54b689cbbe890a98a7ebed3ef9fd0443 Mon Sep 17 00:00:00 2001 From: Valentina Iancu Date: Tue, 1 Jul 2025 17:17:57 +0200 Subject: [PATCH 037/110] refactor(GiniCaptureSDK): Use `GiniUserDefault` from `GiniUtilites` internal SDK PP-1222 --- .../GiniCaptureUserDefaultsStorage.swift | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Storage/GiniCaptureUserDefaultsStorage.swift b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Storage/GiniCaptureUserDefaultsStorage.swift index 3edcaa0a3f..b54c4bfab0 100644 --- a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Storage/GiniCaptureUserDefaultsStorage.swift +++ b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Storage/GiniCaptureUserDefaultsStorage.swift @@ -5,32 +5,32 @@ // import Foundation - +import GiniUtilites /** - This is for internal use only. - A struct that manages user defaults for Gini Capture configurations. + This is for internal use only. + A struct that manages user defaults for Gini Capture configurations. */ public struct GiniCaptureUserDefaultsStorage { - @GiniCaptureUserDefault("ginicapture.defaults.onboardingShowed", defaultValue: false) + @GiniUserDefault("ginicapture.defaults.onboardingShowed", defaultValue: false) public static var onboardingShowed: Bool - + // Configuration flag for the QR code education message - @GiniCaptureUserDefault("ginicapture.defaults.clientConfigurations.qrCodeEducationEnabled", - defaultValue: nil) + @GiniUserDefault("ginicapture.defaults.clientConfigurations.qrCodeEducationEnabled", + defaultValue: nil) public static var qrCodeEducationEnabled: Bool? // Configuration flag for the E-Invoice flow - @GiniCaptureUserDefault("ginicapture.defaults.clientConfigurations.eInvoiceEnabled", - defaultValue: nil) + @GiniUserDefault("ginicapture.defaults.clientConfigurations.eInvoiceEnabled", + defaultValue: nil) public static var eInvoiceEnabled: Bool? - + // Counts how many times the education message was shown in the invoice photo flow - @GiniCaptureUserDefault("ginicapture.defaults.captureInvoice.educationMessageDisplayCount", - defaultValue: 0) + @GiniUserDefault("ginicapture.defaults.captureInvoice.educationMessageDisplayCount", + defaultValue: 0) static var captureInvoiceEducationMessageDisplayCount: Int // Counts how many times the education message was shown in the QR code flow - @GiniCaptureUserDefault("ginicapture.defaults.qrCode.educationMessageDisplayCount", - defaultValue: 0) + @GiniUserDefault("ginicapture.defaults.qrCode.educationMessageDisplayCount", + defaultValue: 0) static var qrCodeEducationMessageDisplayCount: Int } From 52823d154c8c3bd53751a8016834915564c0e135 Mon Sep 17 00:00:00 2001 From: Valentina Iancu Date: Tue, 1 Jul 2025 17:18:10 +0200 Subject: [PATCH 038/110] refactor(GiniBankSDK): Remove `GiniCaptureUserDefault` PP-1222 --- .../GiniUserDefaultPropertyWrapper.swift | 38 ------------------- 1 file changed, 38 deletions(-) delete mode 100644 BankSDK/GiniBankSDK/Sources/GiniBankSDK/Storage/GiniUserDefaultPropertyWrapper.swift diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Storage/GiniUserDefaultPropertyWrapper.swift b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Storage/GiniUserDefaultPropertyWrapper.swift deleted file mode 100644 index 3b3f2382d3..0000000000 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Storage/GiniUserDefaultPropertyWrapper.swift +++ /dev/null @@ -1,38 +0,0 @@ -// -// GiniUserDefaultPropertyWrapper.swift -// -// Copyright © 2024 Gini GmbH. All rights reserved. -// - - -import Foundation - -@propertyWrapper -struct GiniUserDefault { - let key: String - let defaultValue: T - - init(_ key: String, defaultValue: T) { - self.key = key - self.defaultValue = defaultValue - } - - var wrappedValue: T { - get { - // Handle Codable types with JSON encoding/decoding - if let data = UserDefaults.standard.data(forKey: key), - let decodedValue = try? JSONDecoder().decode(T.self, from: data) { - return decodedValue - } - return defaultValue - } - set { - // Handle Codable types with JSON encoding - if let encodedValue = try? JSONEncoder().encode(newValue) { - UserDefaults.standard.set(encodedValue, forKey: key) - } else { - UserDefaults.standard.set(newValue, forKey: key) - } - } - } -} From a3aa00b24711b3175daa8027e4cdb2db55650782 Mon Sep 17 00:00:00 2001 From: Valentina Iancu Date: Tue, 1 Jul 2025 17:18:25 +0200 Subject: [PATCH 039/110] refactor(GiniBankSDK): Use `GiniUserDefault` from `GiniUtilites` internal SDK PP-1222 --- .../GiniBankSDK/Storage/GiniBankUserDefaultsStorage.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Storage/GiniBankUserDefaultsStorage.swift b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Storage/GiniBankUserDefaultsStorage.swift index 716fdbabc6..6ee0dccdf0 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Storage/GiniBankUserDefaultsStorage.swift +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Storage/GiniBankUserDefaultsStorage.swift @@ -7,6 +7,7 @@ import Foundation import GiniBankAPILibrary +import GiniUtilites struct GiniBankUserDefaultsStorage { @GiniUserDefault("ginibank.defaults.client.configurations", defaultValue: nil) From 607981617ca6612696cc21648f9d6203f7863574 Mon Sep 17 00:00:00 2001 From: Valentina Iancu Date: Tue, 1 Jul 2025 17:24:28 +0200 Subject: [PATCH 040/110] refactor(GiniCaptureSDK): Refactor storing the value for `onboardingShowAtLaunch` using `GiniCaptureUserDefaultsStorage` PP-1222 --- .../GiniScreenAPICoordinator.swift | 4 ++-- .../Core/Storage/GiniCaptureUserDefaultsStorage.swift | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Screens/Screen API Coordinator/GiniScreenAPICoordinator.swift b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Screens/Screen API Coordinator/GiniScreenAPICoordinator.swift index 52fdf25242..63f0814214 100644 --- a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Screens/Screen API Coordinator/GiniScreenAPICoordinator.swift +++ b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Screens/Screen API Coordinator/GiniScreenAPICoordinator.swift @@ -404,10 +404,10 @@ extension GiniScreenAPICoordinator: HelpMenuViewControllerDelegate { extension GiniScreenAPICoordinator { func hasOnboardingShownOnLaunch() -> Bool { - return UserDefaults.standard.bool(forKey: "ginicapture.defaults.onboardingShowAtLaunch") + GiniCaptureUserDefaultsStorage.onboardingShowAtLaunch } func setOnboardingShownStatus(show: Bool = false) { - return UserDefaults.standard.set(show, forKey: "ginicapture.defaults.onboardingShowAtLaunch") + GiniCaptureUserDefaultsStorage.onboardingShowAtLaunch = show } } diff --git a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Storage/GiniCaptureUserDefaultsStorage.swift b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Storage/GiniCaptureUserDefaultsStorage.swift index b54c4bfab0..6658603f0a 100644 --- a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Storage/GiniCaptureUserDefaultsStorage.swift +++ b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Storage/GiniCaptureUserDefaultsStorage.swift @@ -11,24 +11,27 @@ import GiniUtilites A struct that manages user defaults for Gini Capture configurations. */ public struct GiniCaptureUserDefaultsStorage { + @GiniUserDefault("ginicapture.defaults.onboardingShowAtLaunch", defaultValue: false) + public static var onboardingShowAtLaunch: Bool + @GiniUserDefault("ginicapture.defaults.onboardingShowed", defaultValue: false) public static var onboardingShowed: Bool - + // Configuration flag for the QR code education message @GiniUserDefault("ginicapture.defaults.clientConfigurations.qrCodeEducationEnabled", defaultValue: nil) public static var qrCodeEducationEnabled: Bool? - + // Configuration flag for the E-Invoice flow @GiniUserDefault("ginicapture.defaults.clientConfigurations.eInvoiceEnabled", defaultValue: nil) public static var eInvoiceEnabled: Bool? - + // Counts how many times the education message was shown in the invoice photo flow @GiniUserDefault("ginicapture.defaults.captureInvoice.educationMessageDisplayCount", defaultValue: 0) static var captureInvoiceEducationMessageDisplayCount: Int - + // Counts how many times the education message was shown in the QR code flow @GiniUserDefault("ginicapture.defaults.qrCode.educationMessageDisplayCount", defaultValue: 0) From e25409e806efafbb2e84927125f628e732aeaed9 Mon Sep 17 00:00:00 2001 From: Valentina Iancu Date: Wed, 2 Jul 2025 15:38:02 +0200 Subject: [PATCH 041/110] refactor(GiniBankAPILibrary): Remove `Logger` PP-1107 --- .../Documents/Core/Logger.swift | 47 ------------------- 1 file changed, 47 deletions(-) delete mode 100644 BankAPILibrary/GiniBankAPILibrary/Sources/GiniBankAPILibrary/Documents/Core/Logger.swift diff --git a/BankAPILibrary/GiniBankAPILibrary/Sources/GiniBankAPILibrary/Documents/Core/Logger.swift b/BankAPILibrary/GiniBankAPILibrary/Sources/GiniBankAPILibrary/Documents/Core/Logger.swift deleted file mode 100644 index ff6dd450aa..0000000000 --- a/BankAPILibrary/GiniBankAPILibrary/Sources/GiniBankAPILibrary/Documents/Core/Logger.swift +++ /dev/null @@ -1,47 +0,0 @@ -// -// Logger.swift -// GiniBankAPI -// -// Created by Enrique del Pozo Gómez on 3/4/19. -// - -import Foundation -import os - -enum LogEvent { - case error - case success - case warning - case custom(String) - - var value: String { - switch self { - case .error: return "❌" - case .success: return "✅" - case .warning: return "⚠️" - case .custom(let emoji): return emoji - } - } -} - -public enum LogLevel { - case none - case debug -} - -func Log(_ message: String, - event: LogEvent) { - guard case .debug = GiniBankAPI.logLevel else { return } - - let prefix = event.value - - // When having the `OS_ACTIVITY_MODE` disabled, NSLog messages are not printed - if ProcessInfo.processInfo.environment["OS_ACTIVITY_MODE"] == "disable" { - print(prefix, message) - } - if #available(macOS 10.12, *) { - os_log("%@ %@", prefix, message) - } else { - // Fallback on earlier versions - } -} From 26875e2337099eca3c170a2ca1cd7d811e57ef57 Mon Sep 17 00:00:00 2001 From: Valentina Iancu Date: Wed, 2 Jul 2025 15:41:57 +0200 Subject: [PATCH 042/110] refactor(GiniBankAPILibrary): Use `Logger` from `GiniUtilites` internal SDK PP-1107 --- .../Documents/Core/GiniBankAPI.swift | 1 + .../Documents/Core/SessionManager.swift | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/BankAPILibrary/GiniBankAPILibrary/Sources/GiniBankAPILibrary/Documents/Core/GiniBankAPI.swift b/BankAPILibrary/GiniBankAPILibrary/Sources/GiniBankAPILibrary/Documents/Core/GiniBankAPI.swift index d5bb282f51..0f43adb72e 100644 --- a/BankAPILibrary/GiniBankAPILibrary/Sources/GiniBankAPILibrary/Documents/Core/GiniBankAPI.swift +++ b/BankAPILibrary/GiniBankAPILibrary/Sources/GiniBankAPILibrary/Documents/Core/GiniBankAPI.swift @@ -6,6 +6,7 @@ // import Foundation +import GiniUtilites /** Sets the default error logger. It is only used when giniErrorLoggerIsOn is true. diff --git a/BankAPILibrary/GiniBankAPILibrary/Sources/GiniBankAPILibrary/Documents/Core/SessionManager.swift b/BankAPILibrary/GiniBankAPILibrary/Sources/GiniBankAPILibrary/Documents/Core/SessionManager.swift index 9aaded0628..4188925d48 100644 --- a/BankAPILibrary/GiniBankAPILibrary/Sources/GiniBankAPILibrary/Documents/Core/SessionManager.swift +++ b/BankAPILibrary/GiniBankAPILibrary/Sources/GiniBankAPILibrary/Documents/Core/SessionManager.swift @@ -6,6 +6,7 @@ // import Foundation +import GiniUtilites /// Represents a completion result callback public typealias CompletionResult = (Result) -> Void @@ -156,7 +157,7 @@ private extension SessionManager { cancellationToken: cancellationToken, completion: completion).resume() } else { - GiniBankAPILibrary.Log("Stored token is no longer valid", event: .warning) + Log("Stored token is no longer valid", event: .warning) handleLoginFlow(resource: resource, taskType: taskType, cancellationToken: cancellationToken, @@ -274,13 +275,13 @@ private extension SessionManager { do { let result = try resource.parsed(response: response, data: data) - GiniBankAPILibrary.Log("Success: \(request.httpMethod!) - \(request.url!)", event: .success) + Log("Success: \(method) - \(url)", event: .success) completion(.success(result)) } catch let error { - GiniBankAPILibrary.Log(""" - Failure: \(request.httpMethod!) - \(request.url!) + Log(""" + Failure: \(method) - \(url) Parse error: \(error) - Data content: \(String(data: data, encoding: .utf8) ?? "nil") + Data content: \(dataString) """, event: .error) completion(.failure(.parseError(message: "Failed to parse response", response: response, From 1e7e558a81cb6185f44cbabbde8938aa1b3eedca Mon Sep 17 00:00:00 2001 From: Valentina Iancu Date: Wed, 2 Jul 2025 17:38:23 +0200 Subject: [PATCH 043/110] refactor(GiniCaptureSDK): Use `Logger` from `GiniUtilites` internal SDK PP-1107 --- .../GiniCaptureSDK/Core/GiniCapture.swift | 3 +- .../Core/GiniConfiguration.swift | 2 +- .../Core/Helpers/GiniCaptureUtils.swift | 3 +- .../Sources/GiniCaptureSDK/Core/Logger.swift | 22 ++----------- .../Core/Screens/Camera/Camera.swift | 11 ++++--- .../GiniScreenAPICoordinator.swift | 6 ++-- .../Networking/DocumentService.swift | 32 +++++++++---------- .../GiniCaptureNetworkService.swift | 25 ++++++++------- .../Networking/GiniErrorLogger.swift | 3 +- 9 files changed, 49 insertions(+), 58 deletions(-) diff --git a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/GiniCapture.swift b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/GiniCapture.swift index 173c9a0c72..edf5a8ab81 100644 --- a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/GiniCapture.swift +++ b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/GiniCapture.swift @@ -7,6 +7,7 @@ // import UIKit +import GiniUtilites public typealias GiniCaptureNetworkDelegate = AnalysisDelegate & UploadDelegate @@ -86,7 +87,7 @@ public typealias GiniCaptureNetworkDelegate = AnalysisDelegate & UploadDelegate GiniConfiguration.shared = configuration if configuration.debugModeOn { - GiniCaptureSDK.Log(message: "DEBUG mode is ON. Never make a release in DEBUG mode!", event: .warning) + Log("DEBUG mode is ON. Never make a release in DEBUG mode!", event: .warning) } } diff --git a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/GiniConfiguration.swift b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/GiniConfiguration.swift index 3b5e670244..759e2af46a 100644 --- a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/GiniConfiguration.swift +++ b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/GiniConfiguration.swift @@ -162,7 +162,7 @@ import GiniBankAPILibrary /** Used to handle all the logging messages in order to log them in a different way. */ - @objc public var logger: GiniLogger = DefaultLogger() + public var logger: GiniLogger = DefaultLogger() /** Indicates whether the multipage feature is enabled or not. In case of `true`, diff --git a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Helpers/GiniCaptureUtils.swift b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Helpers/GiniCaptureUtils.swift index fd56c5ef47..97efdbea07 100644 --- a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Helpers/GiniCaptureUtils.swift +++ b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Helpers/GiniCaptureUtils.swift @@ -6,6 +6,7 @@ // import UIKit +import GiniUtilites public func giniCaptureBundle() -> Bundle { Bundle.resource @@ -234,7 +235,7 @@ func measure(block: () -> Void) { let start = Date() block() let elaspsedTime = Date().timeIntervalSince(start) - GiniCaptureSDK.Log(message: "Elapsed time: \(elaspsedTime) seconds", event: "⏲️") + Log(message: "Elapsed time: \(elaspsedTime) seconds", event: "⏲️") } private class CaptureSDKBundleFinder {} diff --git a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Logger.swift b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Logger.swift index e71d4db567..9cd01fe871 100644 --- a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Logger.swift +++ b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Logger.swift @@ -7,19 +7,7 @@ import Foundation import os - -enum LogEvent: String { - case error = "❌" - case success = "✅" - case warning = "⚠️" -} - -func Log(message: String, - event: LogEvent, - giniConfig: GiniConfiguration = .shared) { - - Log(message: message, event: event.rawValue, giniConfig: giniConfig) -} +import GiniUtilites func Log(message: String, event: String, @@ -29,7 +17,7 @@ func Log(message: String, } } -@objc public protocol GiniLogger: AnyObject { +public protocol GiniLogger: AnyObject { /** Logs a message @@ -45,10 +33,6 @@ public final class DefaultLogger: GiniLogger { public func log(message: String) { let prefix = "[ GiniCapture ]" - // When having the `OS_ACTIVITY_MODE` disabled, NSLog messages are not printed - if ProcessInfo.processInfo.environment["OS_ACTIVITY_MODE"] == "disable" { - print(prefix, message) - } - os_log("%@ %@", prefix, message) + GiniUtilites.Log(message, event: .custom(prefix)) } } diff --git a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Screens/Camera/Camera.swift b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Screens/Camera/Camera.swift index 62fcc1f4c4..0b840079f2 100644 --- a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Screens/Camera/Camera.swift +++ b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Screens/Camera/Camera.swift @@ -11,6 +11,7 @@ import UIKit import AVFoundation import Photos import Vision +import GiniUtilites protocol CameraProtocol: AnyObject { var session: AVCaptureSession { get } @@ -149,7 +150,7 @@ final class Camera: NSObject, CameraProtocol { captureDevice.autoFocusRangeRestriction = .near captureDevice.unlockForConfiguration() } catch { - GiniCaptureSDK.Log(message: "Could not lock device for configuration", event: .error) + Log("Could not lock device for configuration", event: .error) return } } @@ -206,7 +207,7 @@ final class Camera: NSObject, CameraProtocol { sessionQueue.async { guard let device = self.videoDeviceInput?.device else { return } guard case .some = try? device.lockForConfiguration() else { - GiniCaptureSDK.Log(message: "Could not lock device for configuration", event: .error) + Log("Could not lock device for configuration", event: .error) return } @@ -373,13 +374,13 @@ fileprivate extension Camera { // Vision recognition handler. func recognizeTextHandler(request: VNRequest, error: Error?) { if let error = error as NSError? { - GiniCaptureSDK.Log(message: "Error while recognizing IBAN in text due to error \(error.localizedDescription)", + Log("Error while recognizing IBAN in text due to error \(error.localizedDescription)", event: .error) return } guard let results = request.results as? [VNRecognizedTextObservation] else { - GiniCaptureSDK.Log(message: "The observations are of an unexpected type.", + Log("The observations are of an unexpected type.", event: .error) return } @@ -485,7 +486,7 @@ extension Camera: AVCaptureVideoDataOutputSampleBufferDelegate { do { try requestHandler.perform([request]) } catch { - GiniCaptureSDK.Log(message: "Could not perform ocr request due to error \(error.localizedDescription)", + Log("Could not perform ocr request due to error \(error.localizedDescription)", event: .error) return } diff --git a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Screens/Screen API Coordinator/GiniScreenAPICoordinator.swift b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Screens/Screen API Coordinator/GiniScreenAPICoordinator.swift index 52fdf25242..f63101a796 100644 --- a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Screens/Screen API Coordinator/GiniScreenAPICoordinator.swift +++ b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Screens/Screen API Coordinator/GiniScreenAPICoordinator.swift @@ -6,6 +6,8 @@ import Foundation import UIKit +import GiniUtilites + protocol Coordinator: AnyObject { var rootViewController: UIViewController { get } } @@ -226,7 +228,7 @@ extension GiniScreenAPICoordinator { if let delegate = self.visionDelegate { delegate.didCancelCapturing() } else { - GiniCaptureSDK.Log(message: "GiniCaptureResultsDelegate is not implemented", event: .error) + Log("GiniCaptureResultsDelegate is not implemented", event: .error) } } @@ -234,7 +236,7 @@ extension GiniScreenAPICoordinator { if let delegate = self.visionDelegate { delegate.didPressEnterManually() } else { - GiniCaptureSDK.Log(message: "GiniCaptureResultsDelegate is not implemented", event: .error) + Log("GiniCaptureResultsDelegate is not implemented", event: .error) } } diff --git a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Networking/DocumentService.swift b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Networking/DocumentService.swift index fd99991556..d96e215b60 100644 --- a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Networking/DocumentService.swift +++ b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Networking/DocumentService.swift @@ -7,7 +7,7 @@ import UIKit import GiniBankAPILibrary - +import GiniUtilites /** Static variable for synchronization to prevent the display of multiple error screens at the same time. */ @@ -148,9 +148,9 @@ public final class DocumentService: DocumentServiceProtocol { } public func sendFeedback(with updatedExtractions: [Extraction], updatedCompoundExtractions: [String: [[Extraction]]]?) { - GiniCaptureSDK.Log(message: "Sending feedback", event: "💬") + Log(message: "Sending feedback", event: "💬") guard let documentId = document?.id else { - GiniCaptureSDK.Log(message: "Cannot send feedback: no document", event: .error) + Log("Cannot send feedback: no document", event: .error) return } attemptFeedback(documentId: documentId, @@ -162,9 +162,9 @@ public final class DocumentService: DocumentServiceProtocol { public func sendSkontoFeedback(with updatedExtractions: [Extraction], updatedCompoundExtractions: [String: [[Extraction]]]?, retryCount: Int) { - GiniCaptureSDK.Log(message: "Sending feedback", event: "💬") + Log(message: "Sending feedback", event: "💬") guard let documentId = document?.id else { - GiniCaptureSDK.Log(message: "Cannot send feedback: no document", event: .error) + Log("Cannot send feedback: no document", event: .error) return } attemptFeedback(documentId: documentId, @@ -184,7 +184,7 @@ public final class DocumentService: DocumentServiceProtocol { switch result { case .success: - GiniCaptureSDK.Log(message: "Feedback sent with \(updatedExtractions.count) extractions and \(updatedCompoundExtractions?.count ?? 0) compound extractions", + Log(message: "Feedback sent with \(updatedExtractions.count) extractions and \(updatedCompoundExtractions?.count ?? 0) compound extractions", event: "🚀") case .failure(let error): self.handleFeedbackFailure(documentId: documentId, @@ -202,7 +202,7 @@ public final class DocumentService: DocumentServiceProtocol { error: Error, retryCount: Int) { if retryCount > 0 { - GiniCaptureSDK.Log(message: "Retrying feedback due to error: \(error). Remaining retries: \(retryCount - 1)", event: .warning) + Log("Retrying feedback due to error: \(error). Remaining retries: \(retryCount - 1)", event: .warning) DispatchQueue.global().asyncAfter(deadline: .now() + 5) { [weak self] in self?.attemptFeedback(documentId: documentId, updatedExtractions: updatedExtractions, @@ -216,7 +216,7 @@ public final class DocumentService: DocumentServiceProtocol { private func handleFeedbackError(documentId: String, error: Error) { let message = "Error sending feedback for document with id: \(documentId) error: \(error)" - GiniCaptureSDK.Log(message: message, event: .error) + Log(message, event: .error) let errorLog = ErrorLog(description: message, error: error) GiniConfiguration.shared.errorLogger.handleErrorLog(error: errorLog) } @@ -232,10 +232,10 @@ public final class DocumentService: DocumentServiceProtocol { captureNetworkService.log(errorEvent: errorEvent) { result in switch result { case .success: - GiniCaptureSDK.Log(message: "Error event sent to Gini", event: .success) + Log("Error event sent to Gini", event: .success) break case .failure(let error): - GiniCaptureSDK.Log(message: "Failed to send error event to Gini: \(error)", event: .error) + Log("Failed to send error event to Gini: \(error)", event: .error) break } } @@ -243,7 +243,7 @@ public final class DocumentService: DocumentServiceProtocol { public func layout(completion: @escaping DocumentLayoutCompletion) { guard let document = document else { - GiniCaptureSDK.Log(message: "Cannot get document layout: no document", event: .error) + Log("Cannot get document layout: no document", event: .error) return } captureNetworkService.layout(for: document) { result in @@ -252,7 +252,7 @@ public final class DocumentService: DocumentServiceProtocol { completion(.success(documentLayout)) case .failure(let error): let message = "Failed to get layout for document with id: \(document.id) error: \(error)" - GiniCaptureSDK.Log(message: message, event: .error) + Log(message, event: .error) completion(.failure(error)) } } @@ -260,7 +260,7 @@ public final class DocumentService: DocumentServiceProtocol { public func pages(completion: @escaping DocumentPagsCompletion) { guard let document = document else { - GiniCaptureSDK.Log(message: "Cannot get document pages", event: .error) + Log("Cannot get document pages", event: .error) return } captureNetworkService.pages(for: document) { result in @@ -269,7 +269,7 @@ public final class DocumentService: DocumentServiceProtocol { completion(.success(pages)) case let .failure(error): let message = "Failed to get pages for document with id: \(document.id) error: \(error)" - GiniCaptureSDK.Log(message: message, event: .error) + Log(message, event: .error) completion(.failure(error)) } } @@ -279,7 +279,7 @@ public final class DocumentService: DocumentServiceProtocol { size: Document.Page.Size, completion: @escaping DocumentPagePreviewCompletion){ guard let document = document else { - GiniCaptureSDK.Log(message: "Cannot get document page", event: .error) + Log("Cannot get document page", event: .error) return } captureNetworkService.documentPage(for: document, @@ -290,7 +290,7 @@ public final class DocumentService: DocumentServiceProtocol { completion(.success(pageData)) case .failure(let error): let message = "Failed to get page for document with id: \(document.id) error: \(error)" - GiniCaptureSDK.Log(message: message, event: .error) + Log(message, event: .error) completion(.failure(error)) } } diff --git a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Networking/GiniCaptureNetworkService.swift b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Networking/GiniCaptureNetworkService.swift index ca94940b3c..10e1b39cb5 100644 --- a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Networking/GiniCaptureNetworkService.swift +++ b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Networking/GiniCaptureNetworkService.swift @@ -6,6 +6,7 @@ import Foundation import GiniBankAPILibrary +import GiniUtilites public protocol GiniCaptureNetworkService: AnyObject { func delete(document: Document, @@ -111,7 +112,7 @@ class DefaultCaptureNetworkService: GiniCaptureNetworkService { switch result { case .success(let result): completion(.success(result)) - GiniCaptureSDK.Log(message: "Deleted \(document.sourceClassification.rawValue) document with id: \(document.id)", + Log(message: "Deleted \(document.sourceClassification.rawValue) document with id: \(document.id)", event: "🗑") case .failure(let error): let message = "Error deleting \(document.sourceClassification.rawValue) document with" + @@ -128,7 +129,7 @@ class DefaultCaptureNetworkService: GiniCaptureNetworkService { metadata: Document.Metadata?, cancellationToken: CancellationToken, completion: @escaping (Result<(document: Document, extractionResult: ExtractionResult), GiniError>) -> Void) { - GiniCaptureSDK.Log(message: "Creating composite document...", event: "📑") + Log(message: "Creating composite document...", event: "📑") let fileName = "Composite-\(NSDate().timeIntervalSince1970)" documentService @@ -139,7 +140,7 @@ class DefaultCaptureNetworkService: GiniCaptureNetworkService { guard let self = self else { return } switch result { case let .success(createdDocument): - GiniCaptureSDK.Log(message: "Starting analysis for composite document \(createdDocument.id)", + Log(message: "Starting analysis for composite document \(createdDocument.id)", event: "🔎") self.startExtraction(for: createdDocument, cancellationToken: cancellationToken, @@ -165,7 +166,7 @@ class DefaultCaptureNetworkService: GiniCaptureNetworkService { metadata.addUploadMetadata(uploadMetadata) return metadata }() - GiniCaptureSDK.Log(message: "Creating document...", event: "📝") + Log(message: "Creating document...", event: "📝") let fileName = "Partial-\(NSDate().timeIntervalSince1970)" @@ -175,7 +176,7 @@ class DefaultCaptureNetworkService: GiniCaptureNetworkService { metadata: documentMetadata) { result in switch result { case let .success(createdDocument): - GiniCaptureSDK.Log(message: "Created document with id: \(createdDocument.id) " + + Log(message: "Created document with id: \(createdDocument.id) " + "for vision document \(document.id)", event: "📄") completion(.success(createdDocument)) case let .failure(error): @@ -218,7 +219,7 @@ class DefaultCaptureNetworkService: GiniCaptureNetworkService { } func layout(for document: Document, completion: @escaping DocumentLayoutCompletion) { - GiniCaptureSDK.Log(message: "Getting layout for document with id: \(document.id) ", event: "📝") + Log(message: "Getting layout for document with id: \(document.id) ", event: "📝") documentService.layout(for: document) { result in switch result { case let .success(layout): @@ -232,7 +233,7 @@ class DefaultCaptureNetworkService: GiniCaptureNetworkService { } func pages(for document: Document, completion: @escaping (Result<[Document.Page], GiniError>) -> Void) { - GiniCaptureSDK.Log(message: "Getting pages for document with id: \(document.id) ", event: "📝") + Log(message: "Getting pages for document with id: \(document.id) ", event: "📝") documentService.pages(in: document) { result in switch result { case let .success(pages): @@ -249,7 +250,7 @@ class DefaultCaptureNetworkService: GiniCaptureNetworkService { pageNumber: Int, size: GiniBankAPILibrary.Document.Page.Size, completion: @escaping DocumentPagePreviewCompletion) { - GiniCaptureSDK.Log(message: "Getting page for document with id: \(document.id) ", event: "📝") + Log(message: "Getting page for document with id: \(document.id) ", event: "📝") documentService.documentPage(for: document, pageNumber: pageNumber, size: size) { result in @@ -275,13 +276,13 @@ class DefaultCaptureNetworkService: GiniCaptureNetworkService { cancellationToken: cancellationToken) { result in switch result { case let .success(extractionResult): - GiniCaptureSDK.Log(message: "Finished analysis process with no errors", event: .success) + Log("Finished analysis process with no errors", event: .success) completion(.success((document, extractionResult))) case let .failure(error): if error == .requestCancelled { - GiniCaptureSDK.Log(message: "Cancelled analysis process", event: .error) + Log("Cancelled analysis process", event: .error) } else { - GiniCaptureSDK.Log(message: "Finished analysis process with error: \(error)", event: .error) + Log("Finished analysis process with error: \(error)", event: .error) } completion(.failure(error)) } @@ -289,7 +290,7 @@ class DefaultCaptureNetworkService: GiniCaptureNetworkService { } private func logError(message: String, error: GiniError) { - GiniCaptureSDK.Log(message: message, event: .error) + Log(message, event: .error) let errorLog = ErrorLog(description: message, error: error) GiniConfiguration.shared.errorLogger.handleErrorLog(error: errorLog) } diff --git a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Networking/GiniErrorLogger.swift b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Networking/GiniErrorLogger.swift index 3196c70e4d..249a151df4 100644 --- a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Networking/GiniErrorLogger.swift +++ b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Networking/GiniErrorLogger.swift @@ -7,6 +7,7 @@ import Foundation import GiniBankAPILibrary +import GiniUtilites class GiniErrorLogger: GiniCaptureErrorLoggerDelegate { @@ -17,7 +18,7 @@ class GiniErrorLogger: GiniCaptureErrorLoggerDelegate { } public func handleErrorLog(error: ErrorLog) { - GiniCaptureSDK.Log(message: "Sending error log to Gini: \(error)", event: "📝") + Log(message: "Sending error log to Gini: \(error)", event: "📝") documentService.log(errorEvent: ErrorEvent.from(error)) } } From b094128d7e8bd4754d793324e93ada4621c5ddd8 Mon Sep 17 00:00:00 2001 From: Valentina Iancu Date: Thu, 3 Jul 2025 11:00:06 +0200 Subject: [PATCH 044/110] fix(GiniUtilites): Fix indentation --- GiniComponents/GiniUtilites/Sources/GiniUtilites/Logger.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GiniComponents/GiniUtilites/Sources/GiniUtilites/Logger.swift b/GiniComponents/GiniUtilites/Sources/GiniUtilites/Logger.swift index b1f2d8f88f..e3c3346e7f 100644 --- a/GiniComponents/GiniUtilites/Sources/GiniUtilites/Logger.swift +++ b/GiniComponents/GiniUtilites/Sources/GiniUtilites/Logger.swift @@ -31,7 +31,7 @@ public enum LogLevel { } public func Log(_ message: String, - event: LogEvent) { + event: LogEvent) { let prefix = event.value // When having the `OS_ACTIVITY_MODE` disabled, NSLog messages are not printed From 5f5672ed47814c97cb4e7c0fb2ff6946bc77c357 Mon Sep 17 00:00:00 2001 From: Valentina Iancu Date: Thu, 3 Jul 2025 11:09:44 +0200 Subject: [PATCH 045/110] refactor(GiniCaptureSDK): Use `Logger` from `GiniUtilites` internal SDK PP-1107 --- .../GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Logger.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Logger.swift b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Logger.swift index 9cd01fe871..2527826c3b 100644 --- a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Logger.swift +++ b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Logger.swift @@ -33,6 +33,6 @@ public final class DefaultLogger: GiniLogger { public func log(message: String) { let prefix = "[ GiniCapture ]" - GiniUtilites.Log(message, event: .custom(prefix)) + Log(message, event: .custom(prefix)) } } From 6ddf0d95660d53d103b78069918dfbf393db3a4a Mon Sep 17 00:00:00 2001 From: Valentina Iancu Date: Thu, 3 Jul 2025 15:42:59 +0200 Subject: [PATCH 046/110] refactor(GiniUtilites): Move `Logger` file into a dedicated folder and add code documentation PP-1107 --- .../Sources/GiniUtilites/Logger.swift | 46 ---------- .../Sources/GiniUtilites/Logger/Logger.swift | 84 +++++++++++++++++++ 2 files changed, 84 insertions(+), 46 deletions(-) delete mode 100644 GiniComponents/GiniUtilites/Sources/GiniUtilites/Logger.swift create mode 100644 GiniComponents/GiniUtilites/Sources/GiniUtilites/Logger/Logger.swift diff --git a/GiniComponents/GiniUtilites/Sources/GiniUtilites/Logger.swift b/GiniComponents/GiniUtilites/Sources/GiniUtilites/Logger.swift deleted file mode 100644 index e3c3346e7f..0000000000 --- a/GiniComponents/GiniUtilites/Sources/GiniUtilites/Logger.swift +++ /dev/null @@ -1,46 +0,0 @@ -// -// Logger.swift -// -// Copyright © 2024 Gini GmbH. All rights reserved. -// - - - -import Foundation -import os - -public enum LogEvent { - case error - case success - case warning - case custom(String) - - var value: String { - switch self { - case .error: return "❌" - case .success: return "✅" - case .warning: return "⚠️" - case .custom(let emoji): return emoji - } - } -} - -public enum LogLevel { - case none - case debug -} - -public func Log(_ message: String, - event: LogEvent) { - let prefix = event.value - - // When having the `OS_ACTIVITY_MODE` disabled, NSLog messages are not printed - if ProcessInfo.processInfo.environment["OS_ACTIVITY_MODE"] == "disable" { - print(prefix, message) - } - if #available(macOS 10.12, *) { - os_log("%@ %@", prefix, message) - } else { - // Fallback on earlier versions - } -} diff --git a/GiniComponents/GiniUtilites/Sources/GiniUtilites/Logger/Logger.swift b/GiniComponents/GiniUtilites/Sources/GiniUtilites/Logger/Logger.swift new file mode 100644 index 0000000000..6533336ba3 --- /dev/null +++ b/GiniComponents/GiniUtilites/Sources/GiniUtilites/Logger/Logger.swift @@ -0,0 +1,84 @@ +// +// Logger.swift +// +// Copyright © 2024 Gini GmbH. All rights reserved. +// + + + +import Foundation +import os + +/** + Represents the type of event being logged. + + Used to categorize log messages with a symbolic prefix to visually distinguish + between different types of events, such as errors, warnings, and successes. + */ +public enum LogEvent { + /// Indicates an error event (❌). + case error + + /// Indicates a success event (✅). + case success + + /// Indicates a warning event (⚠️). + case warning + + /** + Represents a custom log event with a user-defined symbol or marker. + + - parameter symbol: A string used to prefix the log message, such as a character or icon. + */ + case custom(String) + + /// The symbol associated with the log event. + var value: String { + switch self { + case .error: return "❌" + case .success: return "✅" + case .warning: return "⚠️" + case .custom(let symbol): return symbol + } + } +} + +/** + Represents the log level configuration. + + Can be used to enable or disable logging output globally. + */ +public enum LogLevel { + /// Logging is completely disabled. + case none + + /// Debug-level logging is enabled. + case debug +} + +/** + Logs a message with an associated event type. + + This function outputs the message prefixed by a symbol that identifies + the nature of the event. It uses `os_log` when available, and falls back + to `print` when logging is disabled via `OS_ACTIVITY_MODE`. + + - Parameters: + - message: The content to be logged. + - event: The `LogEvent` indicating the type of event (e.g., error, success, custom). + */ +public func Log(_ message: String, + event: LogEvent) { + let prefix = event.value + + // When the `OS_ACTIVITY_MODE` is disabled, NSLog messages may not appear + if ProcessInfo.processInfo.environment["OS_ACTIVITY_MODE"] == "disable" { + print(prefix, message) + } + if #available(macOS 10.12, *) { + os_log("%@ %@", prefix, message) + } else { + // Fallback on earlier versions + } +} + From 7b4c1f8cdbea3ea73a76749638f3ca950692f65e Mon Sep 17 00:00:00 2001 From: Valentina Iancu Date: Thu, 3 Jul 2025 15:44:42 +0200 Subject: [PATCH 047/110] refactor(GiniUtilites): Add `GiniLogger` protocol to define a basic logging interface used across Gini SDKs from GiniCaptureSDK PP-1107 --- .../GiniUtilites/Logger/GiniLogger.swift | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 GiniComponents/GiniUtilites/Sources/GiniUtilites/Logger/GiniLogger.swift diff --git a/GiniComponents/GiniUtilites/Sources/GiniUtilites/Logger/GiniLogger.swift b/GiniComponents/GiniUtilites/Sources/GiniUtilites/Logger/GiniLogger.swift new file mode 100644 index 0000000000..94191a9ffd --- /dev/null +++ b/GiniComponents/GiniUtilites/Sources/GiniUtilites/Logger/GiniLogger.swift @@ -0,0 +1,27 @@ +// +// GiniLogger.swift +// +// Copyright © 2025 Gini GmbH. All rights reserved. +// +/** + A protocol defining a basic logging interface used across Gini SDKs. + + Conforming types should implement logic to output log messages, + potentially with symbols or context to identify the source or severity + of the message. + + This allows for dependency injection and consistent logging behavior + across different modules. + */ +public protocol GiniLogger: AnyObject { + + /** + Logs a message. + + Implementations may format or prefix the message based on internal settings, + such as the type of event, log level, or module identity. + + - parameter message: The message to be logged. + */ + func log(message: String) +} From bafe5917090269cfb110962f2e2223a1cef15091 Mon Sep 17 00:00:00 2001 From: Valentina Iancu Date: Thu, 3 Jul 2025 15:45:25 +0200 Subject: [PATCH 048/110] refactor(GiniUtilites): Add `DefaultLogger` a default implementation of the `GiniLogger` protocol that logs messages PP-1107 --- .../GiniUtilites/Logger/DefaultLogger.swift | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 GiniComponents/GiniUtilites/Sources/GiniUtilites/Logger/DefaultLogger.swift diff --git a/GiniComponents/GiniUtilites/Sources/GiniUtilites/Logger/DefaultLogger.swift b/GiniComponents/GiniUtilites/Sources/GiniUtilites/Logger/DefaultLogger.swift new file mode 100644 index 0000000000..0abf296c46 --- /dev/null +++ b/GiniComponents/GiniUtilites/Sources/GiniUtilites/Logger/DefaultLogger.swift @@ -0,0 +1,36 @@ +// +// DefaultLogger.swift +// +// Copyright © 2025 Gini GmbH. All rights reserved. +// + +/** + A default implementation of the `GiniLogger` protocol that logs messages + with a customizable prefix. The prefix is used to help identify which SDK or + module the log messages originate from. + */ +public final class DefaultLogger: GiniLogger { + + /// The prefix used to identify the source of the log message. + private let prefix: String + + /** + Initializes a new instance of `DefaultLogger` with a custom prefix. + + - Parameters: + - prefix: A string that will be prefixed to every log message. + */ + public init(prefix: String) { + self.prefix = prefix + } + + /** + Logs a message with the configured prefix. + + - Parameters: + - message: The message to log. + */ + public func log(message: String) { + Log(message, event: .custom(prefix)) + } +} From 5986ffeb2bc88b44fb18d99c34d267043158bd27 Mon Sep 17 00:00:00 2001 From: Valentina Iancu Date: Thu, 3 Jul 2025 15:45:56 +0200 Subject: [PATCH 049/110] refactor(GiniCaptureSDK): Use `DefaultLogger` from `GiniUtilites` internal SDK PP-1107 --- .../Sources/GiniCaptureSDK/Core/GiniConfiguration.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/GiniConfiguration.swift b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/GiniConfiguration.swift index 759e2af46a..cdd7421c1c 100644 --- a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/GiniConfiguration.swift +++ b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/GiniConfiguration.swift @@ -8,6 +8,8 @@ import UIKit import GiniBankAPILibrary +import GiniUtilites + /** The `GiniColor` class allows to customize color for the light and the dark modes. */ @@ -162,7 +164,7 @@ import GiniBankAPILibrary /** Used to handle all the logging messages in order to log them in a different way. */ - public var logger: GiniLogger = DefaultLogger() + public var logger: GiniLogger = DefaultLogger(prefix: "[GiniCapture SDK]") /** Indicates whether the multipage feature is enabled or not. In case of `true`, From e8c62619d43265e33fcfe05663ec8cf7de206ac6 Mon Sep 17 00:00:00 2001 From: Valentina Iancu Date: Thu, 3 Jul 2025 15:47:13 +0200 Subject: [PATCH 050/110] refactor(GiniCaptureSDK): Cleanup `DefaultLogger` PP-1107 --- .../Sources/GiniCaptureSDK/Core/Logger.swift | 29 +++---------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Logger.swift b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Logger.swift index 2527826c3b..279cc115fe 100644 --- a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Logger.swift +++ b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Logger.swift @@ -9,30 +9,9 @@ import Foundation import os import GiniUtilites -func Log(message: String, - event: String, - giniConfig: GiniConfiguration = .shared) { - if giniConfig.debugModeOn { - giniConfig.logger.log(message: "\(event) \(message)") - } -} - -public protocol GiniLogger: AnyObject { - - /** - Logs a message - - - parameter message: Message printed out - - */ - func log(message: String) -} - -public final class DefaultLogger: GiniLogger { - - public func log(message: String) { - let prefix = "[ GiniCapture ]" - - Log(message, event: .custom(prefix)) +func Log(message: String, event: String) { + let giniConfiguration = GiniConfiguration.shared + if giniConfiguration.debugModeOn { + giniConfiguration.logger.log(message: "\(event) \(message)") } } From f27118d59395b58dafde6d4674ae5bb687505824 Mon Sep 17 00:00:00 2001 From: Valentina Iancu Date: Thu, 3 Jul 2025 15:47:27 +0200 Subject: [PATCH 051/110] refactor(GiniBankSDK): Use `DefaultLogger` from `GiniUtilites` internal SDK PP-1107 --- .../Sources/GiniBankSDK/Core/GiniBankConfiguration.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/GiniBankConfiguration.swift b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/GiniBankConfiguration.swift index 8d1ba81fa7..340d10c884 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/GiniBankConfiguration.swift +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/GiniBankConfiguration.swift @@ -8,6 +8,7 @@ import UIKit import GiniCaptureSDK import GiniBankAPILibrary +import GiniUtilites public final class GiniBankConfiguration: NSObject { @@ -370,7 +371,7 @@ public final class GiniBankConfiguration: NSObject { /** Used to handle all the logging messages in order to log them in a different way. */ - public var logger: GiniLogger = GiniConfiguration.shared.logger + public var logger: GiniLogger = DefaultLogger(prefix: "[GiniBank SDK]") /** Should be set if the custom error logging is implemented. From 6c0ba86dbc4ee4c1c77904a1b3567e0ebe9012e2 Mon Sep 17 00:00:00 2001 From: Valentina Iancu Date: Thu, 3 Jul 2025 18:25:28 +0200 Subject: [PATCH 052/110] fix(GiniBankAPILibrary): Import `GiniUtilites` PP-1107 --- .../Sources/GiniBankAPILibraryPinning/GiniBankAPI+Pinning.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/BankAPILibrary/GiniBankAPILibraryPinning/Sources/GiniBankAPILibraryPinning/GiniBankAPI+Pinning.swift b/BankAPILibrary/GiniBankAPILibraryPinning/Sources/GiniBankAPILibraryPinning/GiniBankAPI+Pinning.swift index 5ad03e8497..f7977ffef6 100644 --- a/BankAPILibrary/GiniBankAPILibraryPinning/Sources/GiniBankAPILibraryPinning/GiniBankAPI+Pinning.swift +++ b/BankAPILibrary/GiniBankAPILibraryPinning/Sources/GiniBankAPILibraryPinning/GiniBankAPI+Pinning.swift @@ -7,6 +7,7 @@ import TrustKit import GiniBankAPILibrary +import GiniUtilites public extension GiniBankAPI.Builder { From 0ce9a12a3641372f82a9dfe247527f553fb17550 Mon Sep 17 00:00:00 2001 From: Valentina Iancu Date: Thu, 3 Jul 2025 18:41:06 +0200 Subject: [PATCH 053/110] feat(GiniCaptureSDK): Add `GiniUtilites` as dependency inside the `Package-release` file --- CaptureSDK/GiniCaptureSDK/Package-release.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CaptureSDK/GiniCaptureSDK/Package-release.swift b/CaptureSDK/GiniCaptureSDK/Package-release.swift index 33aa21431e..86f0e38579 100644 --- a/CaptureSDK/GiniCaptureSDK/Package-release.swift +++ b/CaptureSDK/GiniCaptureSDK/Package-release.swift @@ -16,7 +16,8 @@ let package = Package( dependencies: [ // Dependencies declare other packages that this package depends on. // .package(url: /* package url */, from: "1.0.0"), - .package(name: "GiniBankAPILibrary", url: "https://github.com/gini/bank-api-library-ios.git", .exact("3.8.0")) + .package(name: "GiniBankAPILibrary", url: "https://github.com/gini/bank-api-library-ios.git", .exact("3.8.0")), + .package(name: "GiniUtilites", url: "https://github.com/gini/utilites-ios.git", .exact("2.0.4")), ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. From e53fb75e4f23123bb02af0498c258ba5f162e622 Mon Sep 17 00:00:00 2001 From: Valentina Iancu Date: Thu, 3 Jul 2025 18:43:22 +0200 Subject: [PATCH 054/110] feat(GiniBankSDK): Remove `GiniUtilites` from the `Package` file --- BankSDK/GiniBankSDK/Package.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/BankSDK/GiniBankSDK/Package.swift b/BankSDK/GiniBankSDK/Package.swift index b1701b0057..444c654a6a 100644 --- a/BankSDK/GiniBankSDK/Package.swift +++ b/BankSDK/GiniBankSDK/Package.swift @@ -16,8 +16,7 @@ let package = Package( dependencies: [ // Dependencies declare other packages that this package depends on. // .package(url: /* package url */, from: "1.0.0"), - .package(name: "GiniCaptureSDK", path: "../../CaptureSDK/GiniCaptureSDK"), - .package(name: "GiniUtilites", path: "../../GiniComponents/GiniUtilites") + .package(name: "GiniCaptureSDK", path: "../../CaptureSDK/GiniCaptureSDK") ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. From d87d781527eabf79ea78eedb986c8eed62a5291f Mon Sep 17 00:00:00 2001 From: Valentina Iancu Date: Mon, 14 Jul 2025 11:18:01 +0200 Subject: [PATCH 055/110] fix(GiniUtilites): Make properties `key` and `defaultValue` as private to encapsulate internal implementation details and avoid accidental external access PP-1222 --- .../GiniUtilites/Storage/GiniUserDefaultPropertyWrapper.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GiniComponents/GiniUtilites/Sources/GiniUtilites/Storage/GiniUserDefaultPropertyWrapper.swift b/GiniComponents/GiniUtilites/Sources/GiniUtilites/Storage/GiniUserDefaultPropertyWrapper.swift index 0fbbf07f18..a4de80cfbf 100644 --- a/GiniComponents/GiniUtilites/Sources/GiniUtilites/Storage/GiniUserDefaultPropertyWrapper.swift +++ b/GiniComponents/GiniUtilites/Sources/GiniUtilites/Storage/GiniUserDefaultPropertyWrapper.swift @@ -15,9 +15,9 @@ import Foundation @propertyWrapper public struct GiniUserDefault { // The key used to store the value in `UserDefaults`. - let key: String + private let key: String // The default value returned if no value is found for the given key. - let defaultValue: T + private let defaultValue: T /** Initializes the property wrapper. From 7200cdff762c082d4beeae7b08aec2cc94810b64 Mon Sep 17 00:00:00 2001 From: Valentina Iancu Date: Mon, 14 Jul 2025 15:53:14 +0200 Subject: [PATCH 056/110] fix(GiniUtilites): Add note `Internal usage only.` into code documentation PP-1222 --- .../GiniUtilites/Storage/GiniUserDefaultPropertyWrapper.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/GiniComponents/GiniUtilites/Sources/GiniUtilites/Storage/GiniUserDefaultPropertyWrapper.swift b/GiniComponents/GiniUtilites/Sources/GiniUtilites/Storage/GiniUserDefaultPropertyWrapper.swift index a4de80cfbf..d343aae5fd 100644 --- a/GiniComponents/GiniUtilites/Sources/GiniUtilites/Storage/GiniUserDefaultPropertyWrapper.swift +++ b/GiniComponents/GiniUtilites/Sources/GiniUtilites/Storage/GiniUserDefaultPropertyWrapper.swift @@ -10,6 +10,8 @@ import Foundation A property wrapper for storing and retrieving `Codable` values in `UserDefaults`. This wrapper automatically encodes and decodes the wrapped value using `JSONEncoder` and `JSONDecoder`. + + - note: Internal usage only. */ @propertyWrapper From 0f76bd13bf02394ada9cb098f3cea73c33f575df Mon Sep 17 00:00:00 2001 From: Valentina Iancu Date: Mon, 14 Jul 2025 17:54:07 +0200 Subject: [PATCH 057/110] fix(GiniUtilites): Remove empty lines PP-1107 --- .../GiniUtilites/Sources/GiniUtilites/Logger/Logger.swift | 2 -- 1 file changed, 2 deletions(-) diff --git a/GiniComponents/GiniUtilites/Sources/GiniUtilites/Logger/Logger.swift b/GiniComponents/GiniUtilites/Sources/GiniUtilites/Logger/Logger.swift index 6533336ba3..276b2d2da6 100644 --- a/GiniComponents/GiniUtilites/Sources/GiniUtilites/Logger/Logger.swift +++ b/GiniComponents/GiniUtilites/Sources/GiniUtilites/Logger/Logger.swift @@ -4,8 +4,6 @@ // Copyright © 2024 Gini GmbH. All rights reserved. // - - import Foundation import os From 06189e75a74bb4292e771c1afece57be71bff743 Mon Sep 17 00:00:00 2001 From: Valentina Iancu Date: Mon, 14 Jul 2025 19:39:22 +0200 Subject: [PATCH 058/110] fix(GiniUtilites): Restore `key` and `defaultValue` to private visibility PP-1222 --- .../GiniUtilites/Storage/GiniUserDefaultPropertyWrapper.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GiniComponents/GiniUtilites/Sources/GiniUtilites/Storage/GiniUserDefaultPropertyWrapper.swift b/GiniComponents/GiniUtilites/Sources/GiniUtilites/Storage/GiniUserDefaultPropertyWrapper.swift index d343aae5fd..4c6a85e934 100644 --- a/GiniComponents/GiniUtilites/Sources/GiniUtilites/Storage/GiniUserDefaultPropertyWrapper.swift +++ b/GiniComponents/GiniUtilites/Sources/GiniUtilites/Storage/GiniUserDefaultPropertyWrapper.swift @@ -17,9 +17,9 @@ import Foundation @propertyWrapper public struct GiniUserDefault { // The key used to store the value in `UserDefaults`. - private let key: String + let key: String // The default value returned if no value is found for the given key. - private let defaultValue: T + let defaultValue: T /** Initializes the property wrapper. From 9a0d705de538a828132f04fb9bf56187a9b090d3 Mon Sep 17 00:00:00 2001 From: Valentina Iancu Date: Mon, 14 Jul 2025 19:41:46 +0200 Subject: [PATCH 059/110] Revert "fix(GiniUtilites): Restore `key` and `defaultValue` to private visibility" This reverts commit 06189e75a74bb4292e771c1afece57be71bff743. --- .../GiniUtilites/Storage/GiniUserDefaultPropertyWrapper.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GiniComponents/GiniUtilites/Sources/GiniUtilites/Storage/GiniUserDefaultPropertyWrapper.swift b/GiniComponents/GiniUtilites/Sources/GiniUtilites/Storage/GiniUserDefaultPropertyWrapper.swift index 4c6a85e934..d343aae5fd 100644 --- a/GiniComponents/GiniUtilites/Sources/GiniUtilites/Storage/GiniUserDefaultPropertyWrapper.swift +++ b/GiniComponents/GiniUtilites/Sources/GiniUtilites/Storage/GiniUserDefaultPropertyWrapper.swift @@ -17,9 +17,9 @@ import Foundation @propertyWrapper public struct GiniUserDefault { // The key used to store the value in `UserDefaults`. - let key: String + private let key: String // The default value returned if no value is found for the given key. - let defaultValue: T + private let defaultValue: T /** Initializes the property wrapper. From 17fd0d25f4e72610dda371e7934dbcc8694b43c6 Mon Sep 17 00:00:00 2001 From: Valentina Iancu Date: Tue, 15 Jul 2025 18:07:40 +0200 Subject: [PATCH 060/110] fix(GiniBankSDK): Remove `GiniUtilites` as a dependency from the `Package` file PP-1222 --- BankSDK/GiniBankSDK/Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BankSDK/GiniBankSDK/Package.swift b/BankSDK/GiniBankSDK/Package.swift index 444c654a6a..50f8ccf4cd 100644 --- a/BankSDK/GiniBankSDK/Package.swift +++ b/BankSDK/GiniBankSDK/Package.swift @@ -24,7 +24,7 @@ let package = Package( .target( name: "GiniBankSDK", - dependencies: ["GiniCaptureSDK", "GiniUtilites"]), + dependencies: ["GiniCaptureSDK"]), .testTarget( name: "GiniBankSDKTests", dependencies: ["GiniBankSDK"], From 146f58b9d0bf12805f8d0fb0a428b968d4304e63 Mon Sep 17 00:00:00 2001 From: Valentina Iancu Date: Tue, 15 Jul 2025 18:16:08 +0200 Subject: [PATCH 061/110] fixGiniBankSDK): Remove `GiniUtilites` from the `Package` file PP-1107 --- BankSDK/GiniBankSDK/Package.swift | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/BankSDK/GiniBankSDK/Package.swift b/BankSDK/GiniBankSDK/Package.swift index b1701b0057..50f8ccf4cd 100644 --- a/BankSDK/GiniBankSDK/Package.swift +++ b/BankSDK/GiniBankSDK/Package.swift @@ -16,8 +16,7 @@ let package = Package( dependencies: [ // Dependencies declare other packages that this package depends on. // .package(url: /* package url */, from: "1.0.0"), - .package(name: "GiniCaptureSDK", path: "../../CaptureSDK/GiniCaptureSDK"), - .package(name: "GiniUtilites", path: "../../GiniComponents/GiniUtilites") + .package(name: "GiniCaptureSDK", path: "../../CaptureSDK/GiniCaptureSDK") ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. @@ -25,7 +24,7 @@ let package = Package( .target( name: "GiniBankSDK", - dependencies: ["GiniCaptureSDK", "GiniUtilites"]), + dependencies: ["GiniCaptureSDK"]), .testTarget( name: "GiniBankSDKTests", dependencies: ["GiniBankSDK"], From df80a04e567d902104531278d2b5d29e7981a2d3 Mon Sep 17 00:00:00 2001 From: Valentina Iancu Date: Fri, 22 Aug 2025 09:39:41 +0200 Subject: [PATCH 062/110] fix(GiniBankAPILibrary): Revert changes to use local Logger in GiniBankAPILibrraySDK PP-1107 --- .../GiniBankAPILibrary/Package.swift | 4 +- .../Documents/Core/GiniBankAPI.swift | 1 - .../Documents/Core/Logger.swift | 47 +++++++++++++++++++ .../Documents/Core/SessionManager.swift | 1 - .../GiniBankAPI+Pinning.swift | 3 +- 5 files changed, 49 insertions(+), 7 deletions(-) create mode 100644 BankAPILibrary/GiniBankAPILibrary/Sources/GiniBankAPILibrary/Documents/Core/Logger.swift diff --git a/BankAPILibrary/GiniBankAPILibrary/Package.swift b/BankAPILibrary/GiniBankAPILibrary/Package.swift index 61206ed139..77162120ef 100644 --- a/BankAPILibrary/GiniBankAPILibrary/Package.swift +++ b/BankAPILibrary/GiniBankAPILibrary/Package.swift @@ -15,14 +15,12 @@ let package = Package( dependencies: [ // Dependencies declare other packages that this package depends on. // .package(url: /* package url */, from: "1.0.0"), - .package(name: "GiniUtilites", path: "../../GiniComponents/GiniUtilites") ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. // Targets can depend on other targets in this package, and on products in packages this package depends on. .target( - name: "GiniBankAPILibrary", - dependencies: ["GiniUtilites"]), + name: "GiniBankAPILibrary"), .testTarget( name: "GiniBankAPILibraryTests", dependencies: ["GiniBankAPILibrary"], diff --git a/BankAPILibrary/GiniBankAPILibrary/Sources/GiniBankAPILibrary/Documents/Core/GiniBankAPI.swift b/BankAPILibrary/GiniBankAPILibrary/Sources/GiniBankAPILibrary/Documents/Core/GiniBankAPI.swift index 0f43adb72e..d5bb282f51 100644 --- a/BankAPILibrary/GiniBankAPILibrary/Sources/GiniBankAPILibrary/Documents/Core/GiniBankAPI.swift +++ b/BankAPILibrary/GiniBankAPILibrary/Sources/GiniBankAPILibrary/Documents/Core/GiniBankAPI.swift @@ -6,7 +6,6 @@ // import Foundation -import GiniUtilites /** Sets the default error logger. It is only used when giniErrorLoggerIsOn is true. diff --git a/BankAPILibrary/GiniBankAPILibrary/Sources/GiniBankAPILibrary/Documents/Core/Logger.swift b/BankAPILibrary/GiniBankAPILibrary/Sources/GiniBankAPILibrary/Documents/Core/Logger.swift new file mode 100644 index 0000000000..9596e03c8b --- /dev/null +++ b/BankAPILibrary/GiniBankAPILibrary/Sources/GiniBankAPILibrary/Documents/Core/Logger.swift @@ -0,0 +1,47 @@ +// +// Logger.swift +// +// Copyright © 2025 Gini GmbH. All rights reserved. +// + + +import Foundation +import os + +enum LogEvent { + case error + case success + case warning + case custom(String) + + var value: String { + switch self { + case .error: return "❌" + case .success: return "✅" + case .warning: return "⚠️" + case .custom(let emoji): return emoji + } + } +} + +public enum LogLevel { + case none + case debug +} + +func Log(_ message: String, + event: LogEvent) { + guard case .debug = GiniBankAPI.logLevel else { return } + + let prefix = event.value + + // When having the `OS_ACTIVITY_MODE` disabled, NSLog messages are not printed + if ProcessInfo.processInfo.environment["OS_ACTIVITY_MODE"] == "disable" { + print(prefix, message) + } + if #available(macOS 10.12, *) { + os_log("%@ %@", prefix, message) + } else { + // Fallback on earlier versions + } +} diff --git a/BankAPILibrary/GiniBankAPILibrary/Sources/GiniBankAPILibrary/Documents/Core/SessionManager.swift b/BankAPILibrary/GiniBankAPILibrary/Sources/GiniBankAPILibrary/Documents/Core/SessionManager.swift index 4188925d48..14e2912e32 100644 --- a/BankAPILibrary/GiniBankAPILibrary/Sources/GiniBankAPILibrary/Documents/Core/SessionManager.swift +++ b/BankAPILibrary/GiniBankAPILibrary/Sources/GiniBankAPILibrary/Documents/Core/SessionManager.swift @@ -6,7 +6,6 @@ // import Foundation -import GiniUtilites /// Represents a completion result callback public typealias CompletionResult = (Result) -> Void diff --git a/BankAPILibrary/GiniBankAPILibraryPinning/Sources/GiniBankAPILibraryPinning/GiniBankAPI+Pinning.swift b/BankAPILibrary/GiniBankAPILibraryPinning/Sources/GiniBankAPILibraryPinning/GiniBankAPI+Pinning.swift index f7977ffef6..533feb71cd 100644 --- a/BankAPILibrary/GiniBankAPILibraryPinning/Sources/GiniBankAPILibraryPinning/GiniBankAPI+Pinning.swift +++ b/BankAPILibrary/GiniBankAPILibraryPinning/Sources/GiniBankAPILibraryPinning/GiniBankAPI+Pinning.swift @@ -2,12 +2,11 @@ // GiniBankAPI+Pinning.swift // GiniBankAPI // -// Created by Enrique del Pozo Gómez on 1/21/18. +// Copyright © 2025 Gini GmbH. All rights reserved. // import TrustKit import GiniBankAPILibrary -import GiniUtilites public extension GiniBankAPI.Builder { From bf0ce1ee2f1a754801c4e58be773bf2efecae5bd Mon Sep 17 00:00:00 2001 From: Valentina Iancu Date: Mon, 25 Aug 2025 15:01:04 +0200 Subject: [PATCH 063/110] fix(GiniCaptureSDK): Remove `enableScaling` from Capture and use from GiniUtilites PP-1107 --- .../Core/Extensions/UILabel.swift | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Extensions/UILabel.swift b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Extensions/UILabel.swift index ceec70dccc..883b914000 100644 --- a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Extensions/UILabel.swift +++ b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Extensions/UILabel.swift @@ -20,21 +20,4 @@ extension UILabel { attributes: [NSAttributedString.Key.font: font], context: nil).size.height } - - /** - Enables font scaling with a minimum size of 10pt. - - - Adjusts the font size to fit the label’s width. - - Sets the minimum scale factor to `10 / font.pointSize`. - For example: - - If font size is 20pt → minimumScaleFactor = 0.5 - - If font size is 15pt → minimumScaleFactor ≈ 0.67 - - Ensures the font never shrinks below 10pt. - - Supports Dynamic Type for accessibility. - */ - public func enableScaling(minimumScaleFactor: CGFloat = 10) { - adjustsFontSizeToFitWidth = true - self.minimumScaleFactor = minimumScaleFactor / font.pointSize - adjustsFontForContentSizeCategory = true - } } From 9bf9db11140d68a7800d18e4d50110ee04a3c52b Mon Sep 17 00:00:00 2001 From: Valentina Iancu Date: Mon, 25 Aug 2025 15:03:00 +0200 Subject: [PATCH 064/110] fix(GiniCaptureSDK): Use `enableScaling` from GiniUtilites PP-1107 --- .../GiniCaptureSDK/Core/Screens/Camera/Views/QRCodeOverlay.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Screens/Camera/Views/QRCodeOverlay.swift b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Screens/Camera/Views/QRCodeOverlay.swift index 6a6506f79c..65747f60b4 100644 --- a/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Screens/Camera/Views/QRCodeOverlay.swift +++ b/CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Screens/Camera/Views/QRCodeOverlay.swift @@ -6,6 +6,7 @@ // import UIKit +import GiniUtilites final class CorrectQRCodeTextContainer: UIView { private let configuration = GiniConfiguration.shared From 95c58c40252ccfda0020225f96e71ed9aa048755 Mon Sep 17 00:00:00 2001 From: Valentina Iancu Date: Mon, 25 Aug 2025 15:04:10 +0200 Subject: [PATCH 065/110] fix(GiniBankSDK): Use `enableScaling` from GiniUtilites PP-1107 --- .../Core/Skonto/Views/SkontoProceedContainerView.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Views/SkontoProceedContainerView.swift b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Views/SkontoProceedContainerView.swift index c7dacfeb95..b9cb2fd159 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Views/SkontoProceedContainerView.swift +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Views/SkontoProceedContainerView.swift @@ -6,6 +6,7 @@ import UIKit import GiniCaptureSDK +import GiniUtilites class SkontoProceedContainerView: UIView { @@ -37,7 +38,7 @@ class SkontoProceedContainerView: UIView { label.text = labelText label.numberOfLines = 1 label.lineBreakMode = .byTruncatingTail - label.enableScaling(minimumScaleFactor: 15) + label.enableScaling(scaleFactor: 15) return label }() @@ -49,7 +50,7 @@ class SkontoProceedContainerView: UIView { let labelText = viewModel.finalAmountToPay.localizedStringWithCurrencyCode label.text = labelText label.numberOfLines = 1 - label.enableScaling(minimumScaleFactor: 15) + label.enableScaling(scaleFactor: 15) label.setContentHuggingPriority(.defaultHigh, for: .horizontal) label.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal) return label From 71e36ad7d00b375e03bfb83ec17d9d6fda9d2995 Mon Sep 17 00:00:00 2001 From: Valentina Iancu Date: Mon, 25 Aug 2025 18:40:52 +0200 Subject: [PATCH 066/110] ci: Update the simulator version to generate the api documentation PP-1107 --- BankAPILibrary/GiniBankAPILibrary/.jazzy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BankAPILibrary/GiniBankAPILibrary/.jazzy.yaml b/BankAPILibrary/GiniBankAPILibrary/.jazzy.yaml index 56e3ff2d7c..40170a15e7 100644 --- a/BankAPILibrary/GiniBankAPILibrary/.jazzy.yaml +++ b/BankAPILibrary/GiniBankAPILibrary/.jazzy.yaml @@ -5,7 +5,7 @@ xcodebuild_arguments: - "-scheme" - GiniBankAPILibrary - "-destination" -- platform=iOS Simulator,OS=17.5,name=iPhone 15 +- platform=iOS Simulator,OS=18.5,name=iPhone 16 author: Gini GmbH author_url: https://gini.net module: GiniBankAPILibrary From b7af946ecf2f463b60829802e0ba9dc86c9ab307 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Sep 2025 18:43:58 +0000 Subject: [PATCH 067/110] build(deps): bump rexml in the bundler group across 1 directory Bumps the bundler group with 1 update in the / directory: [rexml](https://github.com/ruby/rexml). Updates `rexml` from 3.3.9 to 3.4.2 - [Release notes](https://github.com/ruby/rexml/releases) - [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md) - [Commits](https://github.com/ruby/rexml/compare/v3.3.9...v3.4.2) --- updated-dependencies: - dependency-name: rexml dependency-version: 3.4.2 dependency-type: indirect dependency-group: bundler ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 7ce2d16de6..7c34861091 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -247,7 +247,7 @@ GEM trailblazer-option (>= 0.1.1, < 0.2.0) uber (< 0.2.0) retriable (3.1.2) - rexml (3.3.9) + rexml (3.4.2) rouge (2.0.7) ruby-macho (2.5.1) ruby2_keywords (0.0.5) From dcc49aacb5245f453abbfd035242d4f41a2ed288 Mon Sep 17 00:00:00 2001 From: Valentina Iancu Date: Mon, 22 Sep 2025 09:52:55 +0200 Subject: [PATCH 068/110] fix(GiniBankSDK): Fix colors for `disabledText` according to Figma design [ticket PP-1528] --- .../Resources/GiniBankColorScheme.swift | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Resources/GiniBankColorScheme.swift b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Resources/GiniBankColorScheme.swift index b659a4d1c6..60b1643c50 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Resources/GiniBankColorScheme.swift +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Resources/GiniBankColorScheme.swift @@ -41,15 +41,19 @@ extension UIColor { private static func createActionSheetColorScheme() -> GiniColorScheme.ActionSheet { return GiniColorScheme.ActionSheet( - buttonBackground: GiniColor(lightModeColor: .GiniBank.light1.withAlphaComponent(0.72), darkModeColor: .GiniBank.dark5.withAlphaComponent(0.5)), - cancelButtonBackground: GiniColor(lightModeColor: .GiniBank.light1, darkModeColor: .GiniBank.dark3) + buttonBackground: GiniColor(lightModeColor: .GiniBank.light1.withAlphaComponent(0.72), + darkModeColor: .GiniBank.dark5.withAlphaComponent(0.5)), + cancelButtonBackground: GiniColor(lightModeColor: .GiniBank.light1, + darkModeColor: .GiniBank.dark3) ) } private static func createAlertColorScheme() -> GiniColorScheme.Alert { return GiniColorScheme.Alert( - background: GiniColor(lightModeColor: .GiniBank.light2.withAlphaComponent(0.8), darkModeColor: .GiniBank.dark3.withAlphaComponent(0.8)), - divider: GiniColor(lightModeColor: .GiniBank.light6, darkModeColor: .GiniBank.dark4.withAlphaComponent(0.65)) + background: GiniColor(lightModeColor: .GiniBank.light2.withAlphaComponent(0.8), + darkModeColor: .GiniBank.dark3.withAlphaComponent(0.8)), + divider: GiniColor(lightModeColor: .GiniBank.light6, + darkModeColor: .GiniBank.dark4.withAlphaComponent(0.65)) ) } @@ -109,7 +113,8 @@ extension UIColor { private static func createPageControllerColorScheme() -> GiniColorScheme.PageController { return GiniColorScheme.PageController( selected: GiniColor(lightModeColor: .GiniBank.dark1, darkModeColor: .GiniBank.light1), - unselected: GiniColor(lightModeColor: .GiniBank.dark1.withAlphaComponent(0.3), darkModeColor: .GiniBank.light1.withAlphaComponent(0.3)) + unselected: GiniColor(lightModeColor: .GiniBank.dark1.withAlphaComponent(0.3), + darkModeColor: .GiniBank.light1.withAlphaComponent(0.3)) ) } @@ -141,7 +146,8 @@ extension UIColor { private static func createButtonColorScheme() -> GiniColorScheme.Button { return GiniColorScheme.Button( background: GiniColor(lightModeColor: .GiniBank.accent1, darkModeColor: .GiniBank.accent1), - backgroundLoading: GiniColor(lightModeColor: .GiniBank.accent1.withAlphaComponent(0.24), darkModeColor: .GiniBank.accent1.withAlphaComponent(0.24)), + backgroundLoading: GiniColor(lightModeColor: .GiniBank.accent1.withAlphaComponent(0.24), + darkModeColor: .GiniBank.accent1.withAlphaComponent(0.24)), content: GiniColor(lightModeColor: .GiniBank.light1, darkModeColor: .GiniBank.light1) ) } @@ -159,7 +165,7 @@ extension UIColor { border: GiniColor(lightModeColor: .GiniBank.light3, darkModeColor: .GiniBank.dark4), focusedText: GiniColor(lightModeColor: .GiniBank.dark2, darkModeColor: .GiniBank.light1), unfocusedText: GiniColor(lightModeColor: .GiniBank.dark2, darkModeColor: .GiniBank.light1), - disabledText: GiniColor(lightModeColor: .GiniBank.dark2, darkModeColor: .GiniBank.light1), + disabledText: GiniColor(lightModeColor: .GiniBank.dark6, darkModeColor: .GiniBank.dark6), errorText: GiniColor(lightModeColor: .GiniBank.error3, darkModeColor: .GiniBank.error3), labelFocused: GiniColor(lightModeColor: .GiniBank.dark6, darkModeColor: .GiniBank.dark6), labelUnfocused: GiniColor(lightModeColor: .GiniBank.dark6, darkModeColor: .GiniBank.dark6), From 9acde6e0b8b627d552671fbb911494c6e5d33bc8 Mon Sep 17 00:00:00 2001 From: Valentina Iancu Date: Thu, 25 Sep 2025 13:37:00 +0200 Subject: [PATCH 069/110] ci: Fastlane - add a new lane to register new devices from a devices file --- fastlane/Fastfile | 17 +++++++++++++++++ fastlane/devices.txt | 5 +++++ 2 files changed, 22 insertions(+) create mode 100644 fastlane/devices.txt diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 681832a547..ef1d3ed87f 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -496,4 +496,21 @@ platform :ios do sh "cd #{podspecs_repo_sdk_folder_path} && git push origin master" end end +desc <<~DOC + Register new devices from a devices file. + + This lane reads device UDIDs, names, and platforms from a text file and registers them + with your Apple Developer account. The devices file should contain one device + per line in the format from the content of the `./devices.txt` file. + + Parameters: + devices_file - Path to the devices file (default: "./devices.txt") + + Example devices.txt format: + 1234567890abcdef1234567890abcdef12345678 John's ios + abcdef1234567890abcdef1234567890123456 Jane's ios +DOC +lane :register_new_devices do + register_devices(devices_file: "./devices.txt") +end end diff --git a/fastlane/devices.txt b/fastlane/devices.txt new file mode 100644 index 0000000000..2c092e0b74 --- /dev/null +++ b/fastlane/devices.txt @@ -0,0 +1,5 @@ +Device ID Device Name Device Platform +A123456789012345678901234567890123456789 NAME1 ios +B123456789012345678901234567890123456789 NAME2 ios +A5B5CD50-14AB-5AF7-8B78-AB4751AB10A8 NAME3 mac +A5B5CD50-14AB-5AF7-8B78-AB4751AB10A7 NAME4 mac \ No newline at end of file From 8fbf97527e303d5b851dd94aaa055c13eb0adcee Mon Sep 17 00:00:00 2001 From: Lester Batres Date: Tue, 30 Sep 2025 15:36:05 +0200 Subject: [PATCH 070/110] feat(GiniHealthSDKExmple): Update signing configuration to use `fastlane match profiles` --- .../GiniHealthSDKExample.xcodeproj/project.pbxproj | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/HealthSDK/GiniHealthSDKExample/GiniHealthSDKExample.xcodeproj/project.pbxproj b/HealthSDK/GiniHealthSDKExample/GiniHealthSDKExample.xcodeproj/project.pbxproj index 0ac230341d..f312b5fa01 100644 --- a/HealthSDK/GiniHealthSDKExample/GiniHealthSDKExample.xcodeproj/project.pbxproj +++ b/HealthSDK/GiniHealthSDKExample/GiniHealthSDKExample.xcodeproj/project.pbxproj @@ -655,9 +655,11 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = GiniHealthSDKExample/GiniHealthSDKExample.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; - CODE_SIGN_STYLE = Automatic; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = JA825X8F7Z; + DEVELOPMENT_TEAM = ""; + "DEVELOPMENT_TEAM[sdk=iphoneos*]" = JA825X8F7Z; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = GiniHealthSDKExample/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = GiniHealthSDKExample; @@ -681,6 +683,7 @@ PRODUCT_BUNDLE_IDENTIFIER = net.gini.healthsdk.example; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match Development net.gini.healthsdk.example"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; From f8d3a65169ff8bdf6c16a17bd507395b2d147261 Mon Sep 17 00:00:00 2001 From: Lester Batres Date: Tue, 30 Sep 2025 16:38:59 +0200 Subject: [PATCH 071/110] feat(GiniBankSDKExmple): Update signing configuration to use `fastlane match profiles` --- .../project.pbxproj | 39 +++++++++++++------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/BankSDK/GiniBankSDKExample/GiniBankSDKExample.xcodeproj/project.pbxproj b/BankSDK/GiniBankSDKExample/GiniBankSDKExample.xcodeproj/project.pbxproj index 55d7a2f279..e3112e911c 100644 --- a/BankSDK/GiniBankSDKExample/GiniBankSDKExample.xcodeproj/project.pbxproj +++ b/BankSDK/GiniBankSDKExample/GiniBankSDKExample.xcodeproj/project.pbxproj @@ -2134,7 +2134,8 @@ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_IDENTITY = "iPhone Distribution: Gini GmbH (JA825X8F7Z)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = 5; DEVELOPMENT_TEAM = ""; @@ -2162,7 +2163,7 @@ PRODUCT_BUNDLE_IDENTIFIER = net.gini.banksdk.example.swiftui; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; - "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match Development net.gini.banksdk.example.swiftui"; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match AppStore net.gini.banksdk.example.swiftui"; STRING_CATALOG_GENERATE_SYMBOLS = YES; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; @@ -2364,8 +2365,10 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = JA825X8F7Z; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_STYLE = Manual; + DEVELOPMENT_TEAM = ""; + "DEVELOPMENT_TEAM[sdk=iphoneos*]" = JA825X8F7Z; INFOPLIST_FILE = GiniBankSDKExampleBank/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = ( @@ -2374,6 +2377,8 @@ ); PRODUCT_BUNDLE_IDENTIFIER = net.gini.banksdk.example.bank; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match Development net.gini.banksdk.example.bank"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; @@ -2388,8 +2393,10 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = JA825X8F7Z; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; + CODE_SIGN_STYLE = Manual; + DEVELOPMENT_TEAM = ""; + "DEVELOPMENT_TEAM[sdk=iphoneos*]" = JA825X8F7Z; INFOPLIST_FILE = GiniBankSDKExampleBank/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = ( @@ -2398,6 +2405,8 @@ ); PRODUCT_BUNDLE_IDENTIFIER = net.gini.banksdk.example.bank; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match AppStore net.gini.banksdk.example.bank"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; @@ -2542,9 +2551,11 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = ""; CODE_SIGN_ENTITLEMENTS = "GiniBankSDKExample/Example Swift.entitlements"; CODE_SIGN_IDENTITY = "Apple Development"; - CODE_SIGN_STYLE = Automatic; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_STYLE = Manual; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEVELOPMENT_TEAM = JA825X8F7Z; + DEVELOPMENT_TEAM = ""; + "DEVELOPMENT_TEAM[sdk=iphoneos*]" = JA825X8F7Z; INFOPLIST_FILE = GiniBankSDKExample/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = ( @@ -2555,6 +2566,7 @@ PRODUCT_BUNDLE_IDENTIFIER = net.gini.banksdk.example; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match Development net.gini.banksdk.example"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; @@ -2585,7 +2597,7 @@ PRODUCT_BUNDLE_IDENTIFIER = net.gini.banksdk.example; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; - "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Gini Bank SDK Example App Ad-Hoc Distribution"; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match AppStore net.gini.banksdk.example"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; @@ -2651,9 +2663,11 @@ CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CODE_SIGN_ENTITLEMENTS = GiniBankSDKShareExtension/GiniBankSDKShareExtension.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; - CODE_SIGN_STYLE = Automatic; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = JA825X8F7Z; + DEVELOPMENT_TEAM = ""; + "DEVELOPMENT_TEAM[sdk=iphoneos*]" = JA825X8F7Z; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = GiniBankSDKShareExtension/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = GiniBankSDKShareExtension; @@ -2668,6 +2682,7 @@ PRODUCT_BUNDLE_IDENTIFIER = net.gini.banksdk.example.ShareExtension; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match Development net.gini.banksdk.example.ShareExtension"; SKIP_INSTALL = YES; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; @@ -2704,7 +2719,7 @@ PRODUCT_BUNDLE_IDENTIFIER = net.gini.banksdk.example.ShareExtension; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; - "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Gini Bank SDK Share Extension Ad-Hoc Distribution"; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match AppStore net.gini.banksdk.example.ShareExtension"; SKIP_INSTALL = YES; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; From 700d5aa26fb3450a5f63ff1e8e54d3e63d9f8b4a Mon Sep 17 00:00:00 2001 From: Lester Batres Date: Tue, 30 Sep 2025 16:59:11 +0200 Subject: [PATCH 072/110] feat(GiniMerchantSDKExmple): Update signing configuration to use `fastlane match profiles` --- .../project.pbxproj | 40 ++++++------------- .../GiniMerchantSDKExample/Info.plist | 2 - 2 files changed, 13 insertions(+), 29 deletions(-) diff --git a/MerchantSDK/GiniMerchantSDKExample/GiniMerchantSDKExample.xcodeproj/project.pbxproj b/MerchantSDK/GiniMerchantSDKExample/GiniMerchantSDKExample.xcodeproj/project.pbxproj index a29f1192f2..20db2feccc 100644 --- a/MerchantSDK/GiniMerchantSDKExample/GiniMerchantSDKExample.xcodeproj/project.pbxproj +++ b/MerchantSDK/GiniMerchantSDKExample/GiniMerchantSDKExample.xcodeproj/project.pbxproj @@ -8,15 +8,6 @@ /* Begin PBXBuildFile section */ 3A41C7642C50F9FB00EEDCA2 /* OrderDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A41C7632C50F9FB00EEDCA2 /* OrderDetailView.swift */; }; - 507A25E12C355DA900A7106E /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 507A25E02C355DA900A7106E /* AppDelegate.swift */; }; - 507A25E32C355DA900A7106E /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 507A25E22C355DA900A7106E /* SceneDelegate.swift */; }; - 507A25E52C355DA900A7106E /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 507A25E42C355DA900A7106E /* ViewController.swift */; }; - 507A25E82C355DA900A7106E /* Base in Resources */ = {isa = PBXBuildFile; fileRef = 507A25E72C355DA900A7106E /* Base */; }; - 507A25EA2C355DAA00A7106E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 507A25E92C355DAA00A7106E /* Assets.xcassets */; }; - 507A25ED2C355DAA00A7106E /* Base in Resources */ = {isa = PBXBuildFile; fileRef = 507A25EC2C355DAA00A7106E /* Base */; }; - 507A25F82C355DAA00A7106E /* GiniMerchantSDKPinningExampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 507A25F72C355DAA00A7106E /* GiniMerchantSDKPinningExampleTests.swift */; }; - 507A260F2C355F7700A7106E /* GiniMerchantSDKPinning in Frameworks */ = {isa = PBXBuildFile; productRef = 507A260E2C355F7700A7106E /* GiniMerchantSDKPinning */; }; - 507A26122C35B5C200A7106E /* GiniMerchantSDKPinningExampleWrongCertificatesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 507A26112C35B5C200A7106E /* GiniMerchantSDKPinningExampleWrongCertificatesTests.swift */; }; 5024D0472C45613F00324644 /* GiniMerchantSDKExampleWrongCertificatesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5024D0462C45613F00324644 /* GiniMerchantSDKExampleWrongCertificatesTests.swift */; }; 5076CDC92C45574300094FE4 /* GiniMerchantSDKExampleIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5076CDC82C45574300094FE4 /* GiniMerchantSDKExampleIntegrationTests.swift */; }; 50D80D582C245A8900B446A8 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50D80D572C245A8900B446A8 /* AppDelegate.swift */; }; @@ -61,19 +52,6 @@ /* Begin PBXFileReference section */ 3A41C7632C50F9FB00EEDCA2 /* OrderDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderDetailView.swift; sourceTree = ""; }; - 4CF9C0D82C46C60E00AED223 /* GiniMerchantSDKExample.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = GiniMerchantSDKExample.entitlements; sourceTree = ""; }; - 507A25DE2C355DA900A7106E /* GiniMerchantSDKPinningExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GiniMerchantSDKPinningExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 507A25E02C355DA900A7106E /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 507A25E22C355DA900A7106E /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; - 507A25E42C355DA900A7106E /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - 507A25E72C355DA900A7106E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 507A25E92C355DAA00A7106E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 507A25EC2C355DAA00A7106E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 507A25EE2C355DAA00A7106E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 507A25F32C355DAA00A7106E /* GiniMerchantSDKPinningExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = GiniMerchantSDKPinningExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 507A25F72C355DAA00A7106E /* GiniMerchantSDKPinningExampleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GiniMerchantSDKPinningExampleTests.swift; sourceTree = ""; }; - 507A26102C35700F00A7106E /* GiniMerchantSDKPinning */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = GiniMerchantSDKPinning; path = ../GiniMerchantSDKPinning; sourceTree = ""; }; - 507A26112C35B5C200A7106E /* GiniMerchantSDKPinningExampleWrongCertificatesTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GiniMerchantSDKPinningExampleWrongCertificatesTests.swift; sourceTree = ""; }; 4C6B4E552C6206D800FF5B1C /* GiniMerchantSDKExample.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = GiniMerchantSDKExample.entitlements; sourceTree = ""; }; 4CC69EF52C6141AE00430240 /* GiniMerchantSDKExampleTests.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = GiniMerchantSDKExampleTests.xctestplan; sourceTree = ""; }; 5024D0462C45613F00324644 /* GiniMerchantSDKExampleWrongCertificatesTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GiniMerchantSDKExampleWrongCertificatesTests.swift; sourceTree = ""; }; @@ -524,9 +502,11 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = GiniMerchantSDKExample/GiniMerchantSDKExample.entitlements; - CODE_SIGN_STYLE = Automatic; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = JA825X8F7Z; + DEVELOPMENT_TEAM = ""; + "DEVELOPMENT_TEAM[sdk=iphoneos*]" = JA825X8F7Z; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = GiniMerchantSDKExample/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = "Gini Merchant"; @@ -541,8 +521,10 @@ "@executable_path/Frameworks", ); MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = net.gini.merchantsdk.example1; + PRODUCT_BUNDLE_IDENTIFIER = net.gini.merchantsdk.example; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match Development net.gini.merchantsdk.example"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; @@ -559,9 +541,11 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = GiniMerchantSDKExample/GiniMerchantSDKExample.entitlements; - CODE_SIGN_STYLE = Automatic; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; + CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = JA825X8F7Z; + DEVELOPMENT_TEAM = ""; + "DEVELOPMENT_TEAM[sdk=iphoneos*]" = JA825X8F7Z; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = GiniMerchantSDKExample/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = "Gini Merchant"; @@ -578,6 +562,8 @@ MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = net.gini.merchantsdk.example; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match AppStore net.gini.merchantsdk.example"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; diff --git a/MerchantSDK/GiniMerchantSDKExample/GiniMerchantSDKExample/Info.plist b/MerchantSDK/GiniMerchantSDKExample/GiniMerchantSDKExample/Info.plist index 659eaae199..b1115e7c8c 100644 --- a/MerchantSDK/GiniMerchantSDKExample/GiniMerchantSDKExample/Info.plist +++ b/MerchantSDK/GiniMerchantSDKExample/GiniMerchantSDKExample/Info.plist @@ -2,8 +2,6 @@ - LSSupportsOpeningDocumentsInPlace - CFBundleDocumentTypes From bf4ad583ad60f4d329571dc5a0f011f881579014 Mon Sep 17 00:00:00 2001 From: Lester Batres Date: Tue, 30 Sep 2025 17:53:40 +0200 Subject: [PATCH 073/110] ci: Add `Fastfile_signing` to handle all the logic related to app signing. --- fastlane/Fastfile_signing | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 fastlane/Fastfile_signing diff --git a/fastlane/Fastfile_signing b/fastlane/Fastfile_signing new file mode 100644 index 0000000000..543ddc2f53 --- /dev/null +++ b/fastlane/Fastfile_signing @@ -0,0 +1,17 @@ +default_platform(:ios) + +platform :ios do + + desc <<~DOC + Download the provisioning profiles stored in the remote repository to be used in github actions + DOC + lane :download_profiles do + match( + app_identifier: ENV["APP_IDENTIFIER"], + type: ENV["DISTRIBUTION_TYPE"], + git_url: ENV["GIT_URL"], + password: ENV["MATCH_PASSWORD"], + readonly: true + ) + end +end \ No newline at end of file From 5050b2cfc68317eb759689d842507cd180872c8a Mon Sep 17 00:00:00 2001 From: Lester Batres Date: Tue, 30 Sep 2025 17:53:57 +0200 Subject: [PATCH 074/110] ci: Add `Fastfile_signing` to handle all the logic related to app signing. PP-1810 --- fastlane/Fastfile | 1 + 1 file changed, 1 insertion(+) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index aed4c4e0b7..74443a39b6 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -21,6 +21,7 @@ load "util/git.rb" load "util/swift_package_releases.rb" load "util/add_files_to_project.rb" load "util/sbom.rb" +load "Fastfile_signing" platform :ios do desc <<~DOC From d22df08236224769f44de5b2b3663868142b790d Mon Sep 17 00:00:00 2001 From: Lester Batres Date: Tue, 30 Sep 2025 17:54:50 +0200 Subject: [PATCH 075/110] ci: Update `merchant-sdk.publish.example.apps.firebase.yml` to use `fastlane match` instead of environment profiles. PP-1810 --- ...hant-sdk.publish.example.apps.firebase.yml | 35 +++++-------------- 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml b/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml index 51693903c6..9e6c6df1a5 100644 --- a/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml +++ b/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml @@ -29,33 +29,14 @@ jobs: xcode-version: '16.4' - name: Setup provisioning profile - env: - BUILD_CERTIFICATE_BASE64: ${{ secrets.GINI_DISTRIBUTION_CERTIFICATE }} - P12_PASSWORD: ${{ secrets.GINI_DISTRIBUTION_CERTIFICATE_SECRET }} - BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.GINI_MERCHANT_SDK_EXAMPLE_APP_ADHOC_DISTRIBUTION_PROVISION_PROFILE }} - KEYCHAIN_PASSWORD: ${{ secrets.GINI_DISTRIBUTION_CERTIFICATE_SECRET }} - run: | - CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 - PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision - - KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db - - # import certificate and provisioning profile from secrets - echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH - echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode --output $PP_PATH - - # create temporary keychain - security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH - security set-keychain-settings -lut 21600 $KEYCHAIN_PATH - security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH - - # import certificate to keychain - security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH - security list-keychain -d user -s $KEYCHAIN_PATH - - # apply provisioning profile - mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles - cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles + uses: maierj/fastlane-action@5a3b971aaa26776459bb26894d6c1a1a84a311a7 # v3.1.0 + with: + lane: 'download_profiles' + env: + APP_IDENTIFIER: net.gini.merchantsdk.example + DISTRIBUTION_TYPE: adhoc + GIT_URL: ${{ secrets.MATCH_GIT_URL }} + MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} - name: Setup Manual Signing for Xcode project uses: ruby/setup-ruby@dffc446db9ba5a0c4446edb5bca1c5c473a806c5 # v1.245.0 From cbe123056da8f3a87b4e0b2c63846dd0fd0a665e Mon Sep 17 00:00:00 2001 From: Lester Batres Date: Tue, 30 Sep 2025 17:59:10 +0200 Subject: [PATCH 076/110] ci: Update `merchant-sdk.publish.example.apps.firebase.yml` to use `fastlane match` instead of environment profiles. PP-1810 --- .../merchant-sdk.publish.example.apps.firebase.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml b/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml index 9e6c6df1a5..cfdb0e475d 100644 --- a/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml +++ b/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml @@ -30,13 +30,13 @@ jobs: - name: Setup provisioning profile uses: maierj/fastlane-action@5a3b971aaa26776459bb26894d6c1a1a84a311a7 # v3.1.0 + env: + APP_IDENTIFIER: net.gini.merchantsdk.example + DISTRIBUTION_TYPE: adhoc + GIT_URL: ${{ secrets.MATCH_GIT_URL }} + MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} with: lane: 'download_profiles' - env: - APP_IDENTIFIER: net.gini.merchantsdk.example - DISTRIBUTION_TYPE: adhoc - GIT_URL: ${{ secrets.MATCH_GIT_URL }} - MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} - name: Setup Manual Signing for Xcode project uses: ruby/setup-ruby@dffc446db9ba5a0c4446edb5bca1c5c473a806c5 # v1.245.0 From 25e5a2c4e62c0a3ee1f1fc7c762fa7a2e9fd696b Mon Sep 17 00:00:00 2001 From: Lester Batres Date: Tue, 30 Sep 2025 18:15:17 +0200 Subject: [PATCH 077/110] ci: Update `merchant-sdk.publish.example.apps.firebase.yml` to use `fastlane match` instead of environment profiles. PP-1810 --- .../workflows/merchant-sdk.publish.example.apps.firebase.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml b/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml index cfdb0e475d..0f920d8999 100644 --- a/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml +++ b/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml @@ -29,6 +29,10 @@ jobs: xcode-version: '16.4' - name: Setup provisioning profile + uses: ruby/setup-ruby@dffc446db9ba5a0c4446edb5bca1c5c473a806c5 # v1.245.0 + with: + ruby-version: '3.2.0' + bundler-cache: true uses: maierj/fastlane-action@5a3b971aaa26776459bb26894d6c1a1a84a311a7 # v3.1.0 env: APP_IDENTIFIER: net.gini.merchantsdk.example From 7d69a1147f6fc92221d73e3379bcf189001e853f Mon Sep 17 00:00:00 2001 From: Lester Batres Date: Tue, 30 Sep 2025 18:18:43 +0200 Subject: [PATCH 078/110] ci: Add shared `ruby` configuration `step` for `merchant-sdk.publish.example.apps.firebase.yml` PP-1810 --- .../merchant-sdk.publish.example.apps.firebase.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml b/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml index 0f920d8999..a6b214f5b3 100644 --- a/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml +++ b/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml @@ -28,11 +28,13 @@ jobs: with: xcode-version: '16.4' - - name: Setup provisioning profile + - name: Setup Ruby uses: ruby/setup-ruby@dffc446db9ba5a0c4446edb5bca1c5c473a806c5 # v1.245.0 with: ruby-version: '3.2.0' bundler-cache: true + + - name: Setup provisioning profile uses: maierj/fastlane-action@5a3b971aaa26776459bb26894d6c1a1a84a311a7 # v3.1.0 env: APP_IDENTIFIER: net.gini.merchantsdk.example @@ -43,11 +45,7 @@ jobs: lane: 'download_profiles' - name: Setup Manual Signing for Xcode project - uses: ruby/setup-ruby@dffc446db9ba5a0c4446edb5bca1c5c473a806c5 # v1.245.0 - with: - ruby-version: '3.2.0' - bundler-cache: true - - uses: maierj/fastlane-action@5a3b971aaa26776459bb26894d6c1a1a84a311a7 # v3.1.0 + uses: maierj/fastlane-action@5a3b971aaa26776459bb26894d6c1a1a84a311a7 # v3.1.0 with: lane: 'setup_manual_signing' options: > From 600508b7345a92bc9e0e12538888e5731d3bc57b Mon Sep 17 00:00:00 2001 From: Lester Batres Date: Tue, 30 Sep 2025 18:24:10 +0200 Subject: [PATCH 079/110] ci: Add shared `ruby` configuration `step` for `merchant-sdk.publish.example.apps.firebase.yml` PP-1810 --- fastlane/Fastfile_signing | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/fastlane/Fastfile_signing b/fastlane/Fastfile_signing index 543ddc2f53..15c3dc1403 100644 --- a/fastlane/Fastfile_signing +++ b/fastlane/Fastfile_signing @@ -1,7 +1,21 @@ +# This file contains the fastlane.tools configuration +# You can find the documentation at https://docs.fastlane.tools +# +# For a list of all available actions, check out +# +# https://docs.fastlane.tools/actions +# +# For a list of all available plugins, check out +# +# https://docs.fastlane.tools/plugins/available-plugins +# + +# Uncomment the line if you want fastlane to automatically update itself +# update_fastlane + default_platform(:ios) platform :ios do - desc <<~DOC Download the provisioning profiles stored in the remote repository to be used in github actions DOC From 70933264a1a205ebf17865897dbe8ae8b2c8d6f6 Mon Sep 17 00:00:00 2001 From: Lester Batres Date: Tue, 30 Sep 2025 18:27:22 +0200 Subject: [PATCH 080/110] ci: Fix `fastfile` import PP-1810 --- fastlane/Fastfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 74443a39b6..83ff957c3a 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -21,7 +21,7 @@ load "util/git.rb" load "util/swift_package_releases.rb" load "util/add_files_to_project.rb" load "util/sbom.rb" -load "Fastfile_signing" +import "Fastfile_signing" platform :ios do desc <<~DOC From 0064f79081b3145dcd52561632399f8b9b48c1dc Mon Sep 17 00:00:00 2001 From: Lester Batres Date: Tue, 30 Sep 2025 18:58:03 +0200 Subject: [PATCH 081/110] ci: Remove incorrect `match` parameter PP-1810 --- fastlane/Fastfile_signing | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fastlane/Fastfile_signing b/fastlane/Fastfile_signing index 15c3dc1403..1e9ce24011 100644 --- a/fastlane/Fastfile_signing +++ b/fastlane/Fastfile_signing @@ -23,8 +23,7 @@ platform :ios do match( app_identifier: ENV["APP_IDENTIFIER"], type: ENV["DISTRIBUTION_TYPE"], - git_url: ENV["GIT_URL"], - password: ENV["MATCH_PASSWORD"], + git_url: ENV["GIT_URL"] readonly: true ) end From b390314a424a992212b5617f3cf0a2e726d88f1b Mon Sep 17 00:00:00 2001 From: Lester Batres Date: Tue, 30 Sep 2025 19:01:47 +0200 Subject: [PATCH 082/110] ci: Remove incorrect `match` parameter PP-1810 --- fastlane/Fastfile_signing | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlane/Fastfile_signing b/fastlane/Fastfile_signing index 1e9ce24011..4b29763af2 100644 --- a/fastlane/Fastfile_signing +++ b/fastlane/Fastfile_signing @@ -23,7 +23,7 @@ platform :ios do match( app_identifier: ENV["APP_IDENTIFIER"], type: ENV["DISTRIBUTION_TYPE"], - git_url: ENV["GIT_URL"] + git_url: ENV["GIT_URL"], readonly: true ) end From d7046c4c10c5657c87d00ce3cd21e1e59f55a6ac Mon Sep 17 00:00:00 2001 From: Lester Batres Date: Tue, 30 Sep 2025 19:13:07 +0200 Subject: [PATCH 083/110] ci: Update `workflow` configuration to match `fastlane` values. PP-1810 --- .../workflows/merchant-sdk.publish.example.apps.firebase.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml b/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml index a6b214f5b3..11129eb8eb 100644 --- a/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml +++ b/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml @@ -54,7 +54,7 @@ jobs: "team_id":"JA825X8F7Z", "target":"GiniMerchantSDKExample", "bundle_identifier": "net.gini.merchantsdk.example", - "profile_name": "Gini Merchant SDK Example App Ad-Hoc Distribution", + "profile_name": "match AdHoc net.gini.merchantsdk.example", "entitlements_file_path": "GiniMerchantSDKExample/GiniMerchantSDKExample.entitlements", "ci": "true" } @@ -74,7 +74,7 @@ jobs: -archivePath ./GiniMerchantSDKExample.xcarchive \ -configuration Release \ -destination generic/platform=iOS \ - CODE_SIGN_IDENTITY="Apple Distribution" \ + CODE_SIGN_IDENTITY="iPhone Distribution" \ CODE_SIGNING_REQUIRED=NO \ ONLY_ACTIVE_ARCH=NO \ CODE_SIGN_STYLE=Manual \ From b1b58cdd1aa977264de2a53be5cf994aa1cfd771 Mon Sep 17 00:00:00 2001 From: Lester Batres Date: Tue, 30 Sep 2025 20:03:26 +0200 Subject: [PATCH 084/110] ci: Update to use `archive` also from fastlane since it needs to use a custom keychain. PP-1810 --- ...hant-sdk.publish.example.apps.firebase.yml | 46 ++---- fastlane/Fastfile_signing | 135 ++++++++++++++++++ 2 files changed, 147 insertions(+), 34 deletions(-) diff --git a/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml b/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml index 11129eb8eb..c02e34dbc2 100644 --- a/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml +++ b/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml @@ -34,16 +34,6 @@ jobs: ruby-version: '3.2.0' bundler-cache: true - - name: Setup provisioning profile - uses: maierj/fastlane-action@5a3b971aaa26776459bb26894d6c1a1a84a311a7 # v3.1.0 - env: - APP_IDENTIFIER: net.gini.merchantsdk.example - DISTRIBUTION_TYPE: adhoc - GIT_URL: ${{ secrets.MATCH_GIT_URL }} - MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} - with: - lane: 'download_profiles' - - name: Setup Manual Signing for Xcode project uses: maierj/fastlane-action@5a3b971aaa26776459bb26894d6c1a1a84a311a7 # v3.1.0 with: @@ -67,30 +57,18 @@ jobs: MerchantSDK/GiniMerchantSDKExample/GiniMerchantSDKExample/Sources/CredentialsManager.swift - name: Archiving project - run: | - xcodebuild clean archive \ - -workspace GiniMobile.xcworkspace \ - -scheme "GiniMerchantSDKExample" \ - -archivePath ./GiniMerchantSDKExample.xcarchive \ - -configuration Release \ - -destination generic/platform=iOS \ - CODE_SIGN_IDENTITY="iPhone Distribution" \ - CODE_SIGNING_REQUIRED=NO \ - ONLY_ACTIVE_ARCH=NO \ - CODE_SIGN_STYLE=Manual \ - DEVELOPMENT_TEAM=JA825X8F7Z - - - name: Exporting .ipa - run: | - xcodebuild \ - -exportArchive \ - -archivePath GiniMerchantSDKExample.xcarchive \ - -exportPath . \ - -exportOptionsPlist ExportOptionsMerchantExample.plist \ - -destination "generic/platform=iOS" \ - CODE_SIGNING_REQUIRED=YES \ - ONLY_ACTIVE_ARCH=NO \ - CODE_SIGN_STYLE=Manual + uses: maierj/fastlane-action@5a3b971aaa26776459bb26894d6c1a1a84a311a7 # v3.1.0 + env: + APP_IDENTIFIER: net.gini.merchantsdk.example + DISTRIBUTION_TYPE: adhoc + GIT_URL: ${{ secrets.MATCH_GIT_URL }} + MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} + KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} + APP_SCHEME: GiniMerchantSDKExample + IPA_FILE: GiniMerchantSDKExample + CODESIGNING_IDENTITY: iPhone Distribution + with: + lane: 'build_app_adhoc' - name: Check file existence uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0 diff --git a/fastlane/Fastfile_signing b/fastlane/Fastfile_signing index 4b29763af2..f46715f7ff 100644 --- a/fastlane/Fastfile_signing +++ b/fastlane/Fastfile_signing @@ -24,7 +24,142 @@ platform :ios do app_identifier: ENV["APP_IDENTIFIER"], type: ENV["DISTRIBUTION_TYPE"], git_url: ENV["GIT_URL"], + keychain_name: "app-signing", + keychain_password:ENV['KEYCHAIN_PASSWORD'], readonly: true ) end + + desc "Build app for ad-hoc distribution" + lane :build_app_adhoc do + build_app_with_provisioning(distribution_type: "adhoc", export_method: "ad-hoc", configuration: "Release") + end + + desc <<~DOC + Create a temporary keychain for CI builds and expose its credentials to the environment. + + Parameters: + keychain_name - Name of the keychain to create. + keychain_password - Password for the keychain. + default_keychain - Whether to set the keychain as the default. + timeout -Auto-lock timeout in seconds. Default: 3600 (1 hour). + + Behavior: + - Creates and unlocks the keychain. + - Exposes keychain_name and keychain_password for reuse in other lanes (e.g., match/gym). + DOC + lane :setup_temp_keychain do + keychain_name = "app-signing" + keychain_password = ENV["KEYCHAIN_PASSWORD"] + + create_keychain( + name: keychain_name, + password: keychain_password, + default_keychain: true, + unlock: true, + timeout: 21600, + lock_when_sleeps: false, + add_to_search_list: true + ) + end + + desc <<~DOC + Unlock the signing keychain and set it as the default so codesign can access identities. + + Parameters: + path - Keychain name or full path. Example: "app-signing" or "app-signing.keychain-db". + password - Password used to unlock the keychain. + set_default - Whether to make the unlocked keychain the default for this session. Here: true. + + Behavior: + - Unlocks the keychain at `path` with the provided password. + - Sets it as the default keychain (because set_default: true), which is often required in CI. + + Environment: + - KEYCHAIN_PASSWORD must be set to the keychain’s password. + DOC + lane :unlock_temp_keychain do + unlock_keychain( + path: "app-signing", + password: ENV['KEYCHAIN_PASSWORD'], + set_default: true + ) + end + + desc "Delete temp signing keychain" + lane :delete_temp_keychain do + delete_keychain(name: "app-signing") + end + + desc <<~DOC + Complete build process for app distribution. + + This lane combines provisioning setup and app building into a single workflow. + It first sets up the necessary code signing certificates and provisioning profiles, + then builds and exports the app as an IPA ready for distribution. + + Parameters: + distribution_type - Type of distribution for provisioning: "adhoc" or "development" (default: "adhoc") + export_method - Export method for build: "ad-hoc" or "development" (default: "ad-hoc") + configuration - The configuration from the Xcode project setup: "Release", "Debug" + + Environment Variables: + APP_IDENTIFIER - Bundle identifier for the app + APP_SCHEME - Xcode scheme to build + IPA_FILE - Output name for the generated IPA file (without extension) + MATCH_GIT_URL - Git URL for the match certificates repository + DOC + lane :build_app_with_provisioning do |options| + distribution_type = options[:distribution_type] + export_method = options[:export_method] + configuration = options[:configuration] + + setup_temp_keychain + unlock_temp_keychain + download_profiles + build_app_match(export_method: export_method, configuration: configuration) + ensure + # Always clean up + delete_temp_keychain + end + + desc <<~DOC + Build and export app as an IPA. + + This lane compiles the specified app scheme, archives it, and exports it as an IPA file + ready for distribution. The build includes cleaning and detailed logging for debugging. + + Parameters: + export_method - Export method: "ad-hoc" or "development" (default: "ad-hoc") + configuration - The configuration from the Xcode project setup: "Release", "Debug" + + Environment Variables: + APP_SCHEME - Xcode scheme to build + IPA_FILE - Output name for the generated IPA file (without extension) + DOC + lane :build_app_match do |options| + scheme = ENV["APP_SCHEME"] + ipaFile = ENV["IPA_FILE"] + export_method = options[:export_method] + configuration = options[:configuration] + + # Skip confirmation for development builds in CI + if export_method == "development" + ENV["FASTLANE_SKIP_WAITING_FOR_BUILD_PROCESSING"] = "true" + puts "⚠️ Skipping waiting for build processing (development build)" + end + gym( + scheme: scheme, + export_method: export_method, + configuration: configuration, + silent: false, + clean: true, + export_options: { + manageAppVersionAndBuildNumber: false + }, + export_team_id: "JA825X8F7Z", + codesigning_identity: ENV["CODESIGNING_IDENTITY"] + output_name: ipaFile + ) + end end \ No newline at end of file From f1f0494ff04c8aa4e21b61275346db2fd9df994e Mon Sep 17 00:00:00 2001 From: Lester Batres Date: Tue, 30 Sep 2025 20:05:41 +0200 Subject: [PATCH 085/110] ci: Update to use `archive` also from fastlane since it needs to use a custom keychain. PP-1810 --- fastlane/Fastfile_signing | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlane/Fastfile_signing b/fastlane/Fastfile_signing index f46715f7ff..0510e92592 100644 --- a/fastlane/Fastfile_signing +++ b/fastlane/Fastfile_signing @@ -158,7 +158,7 @@ platform :ios do manageAppVersionAndBuildNumber: false }, export_team_id: "JA825X8F7Z", - codesigning_identity: ENV["CODESIGNING_IDENTITY"] + codesigning_identity: ENV["CODESIGNING_IDENTITY"], output_name: ipaFile ) end From 054626dc1389d62f9f5f31eb9fd00a5f78353e7b Mon Sep 17 00:00:00 2001 From: Lester Batres Date: Tue, 30 Sep 2025 20:06:57 +0200 Subject: [PATCH 086/110] ci: Update to use `archive` also from fastlane since it needs to use a custom keychain. PP-1810 --- .../workflows/merchant-sdk.publish.example.apps.firebase.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml b/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml index c02e34dbc2..a052a37599 100644 --- a/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml +++ b/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml @@ -16,7 +16,7 @@ concurrency: jobs: upload-version: - environment: firebase-manual-deploy + #environment: firebase-manual-deploy runs-on: macos-latest steps: - name: Checkout repository From bbe7482f656e681e3ae5912b6890131113b88483 Mon Sep 17 00:00:00 2001 From: Lester Batres Date: Tue, 30 Sep 2025 20:25:34 +0200 Subject: [PATCH 087/110] ci: Remove `codesigning_identity` parameter to rely on automatic fastlane. PP-1810 --- .github/workflows/merchant-sdk.publish.example.apps.firebase.yml | 1 - .../GiniMerchantSDKExample.xcodeproj/project.pbxproj | 1 + fastlane/Fastfile_signing | 1 - 3 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml b/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml index a052a37599..db3ea058a6 100644 --- a/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml +++ b/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml @@ -66,7 +66,6 @@ jobs: KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} APP_SCHEME: GiniMerchantSDKExample IPA_FILE: GiniMerchantSDKExample - CODESIGNING_IDENTITY: iPhone Distribution with: lane: 'build_app_adhoc' diff --git a/MerchantSDK/GiniMerchantSDKExample/GiniMerchantSDKExample.xcodeproj/project.pbxproj b/MerchantSDK/GiniMerchantSDKExample/GiniMerchantSDKExample.xcodeproj/project.pbxproj index 20db2feccc..0344c0d8fa 100644 --- a/MerchantSDK/GiniMerchantSDKExample/GiniMerchantSDKExample.xcodeproj/project.pbxproj +++ b/MerchantSDK/GiniMerchantSDKExample/GiniMerchantSDKExample.xcodeproj/project.pbxproj @@ -541,6 +541,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = GiniMerchantSDKExample/GiniMerchantSDKExample.entitlements; + CODE_SIGN_IDENTITY = "iPhone Distribution: Gini GmbH (JA825X8F7Z)"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = 1; diff --git a/fastlane/Fastfile_signing b/fastlane/Fastfile_signing index 0510e92592..95476ed623 100644 --- a/fastlane/Fastfile_signing +++ b/fastlane/Fastfile_signing @@ -158,7 +158,6 @@ platform :ios do manageAppVersionAndBuildNumber: false }, export_team_id: "JA825X8F7Z", - codesigning_identity: ENV["CODESIGNING_IDENTITY"], output_name: ipaFile ) end From 91e22e317e40367e80570aae5aa8d5118e058e6f Mon Sep 17 00:00:00 2001 From: Lester Batres Date: Tue, 30 Sep 2025 21:00:08 +0200 Subject: [PATCH 088/110] ci: Add `Fastfile_archiving` file to put there the logic related to archive and distribute the app Make the internal lanes private PP-1810 --- fastlane/Fastfile | 1 + fastlane/Fastfile_archiving | 81 +++++++++++++++++++++++++++++++ fastlane/Fastfile_signing | 96 ++----------------------------------- 3 files changed, 85 insertions(+), 93 deletions(-) create mode 100644 fastlane/Fastfile_archiving diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 83ff957c3a..34ee823aac 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -22,6 +22,7 @@ load "util/swift_package_releases.rb" load "util/add_files_to_project.rb" load "util/sbom.rb" import "Fastfile_signing" +import "Fastfile_archiving" platform :ios do desc <<~DOC diff --git a/fastlane/Fastfile_archiving b/fastlane/Fastfile_archiving new file mode 100644 index 0000000000..8edb9ff33a --- /dev/null +++ b/fastlane/Fastfile_archiving @@ -0,0 +1,81 @@ + +default_platform(:ios) + +platform :ios do + + desc "Build app for ad-hoc distribution" + lane :build_app_adhoc do + build_app_with_provisioning(distribution_type: "adhoc", export_method: "ad-hoc", configuration: "Release") + end + + desc <<~DOC + Complete build process for app distribution. + + This lane combines provisioning setup and app building into a single workflow. + It first sets up the necessary code signing certificates and provisioning profiles, + then builds and exports the app as an IPA ready for distribution. + + Parameters: + distribution_type - Type of distribution for provisioning: "adhoc" or "development" (default: "adhoc") + export_method - Export method for build: "ad-hoc" or "development" (default: "ad-hoc") + configuration - The configuration from the Xcode project setup: "Release", "Debug" + + Environment Variables: + APP_IDENTIFIER - Bundle identifier for the app + APP_SCHEME - Xcode scheme to build + IPA_FILE - Output name for the generated IPA file (without extension) + MATCH_GIT_URL - Git URL for the match certificates repository + DOC + private_lane :build_app_with_provisioning do |options| + distribution_type = options[:distribution_type] + export_method = options[:export_method] + configuration = options[:configuration] + + setup_temp_keychain + unlock_temp_keychain + download_profiles + build_app_match(export_method: export_method, configuration: configuration) + ensure + # Always clean up + delete_temp_keychain + end + + desc <<~DOC + Build and export app as an IPA. + + This lane compiles the specified app scheme, archives it, and exports it as an IPA file + ready for distribution. The build includes cleaning and detailed logging for debugging. + + Parameters: + export_method - Export method: "ad-hoc" or "development" (default: "ad-hoc") + configuration - The configuration from the Xcode project setup: "Release", "Debug" + + Environment Variables: + APP_SCHEME - Xcode scheme to build + IPA_FILE - Output name for the generated IPA file (without extension) + DOC + private_lane :build_app_match do |options| + scheme = ENV["APP_SCHEME"] + ipaFile = ENV["IPA_FILE"] + export_method = options[:export_method] + configuration = options[:configuration] + + # Skip confirmation for development builds in CI + if export_method == "development" + ENV["FASTLANE_SKIP_WAITING_FOR_BUILD_PROCESSING"] = "true" + puts "⚠️ Skipping waiting for build processing (development build)" + end + gym( + scheme: scheme, + export_method: export_method, + configuration: configuration, + silent: false, + clean: true, + export_options: { + manageAppVersionAndBuildNumber: false + }, + export_team_id: "JA825X8F7Z", + output_name: ipaFile + ) + end +end \ No newline at end of file diff --git a/fastlane/Fastfile_signing b/fastlane/Fastfile_signing index 95476ed623..3941840237 100644 --- a/fastlane/Fastfile_signing +++ b/fastlane/Fastfile_signing @@ -1,17 +1,3 @@ -# This file contains the fastlane.tools configuration -# You can find the documentation at https://docs.fastlane.tools -# -# For a list of all available actions, check out -# -# https://docs.fastlane.tools/actions -# -# For a list of all available plugins, check out -# -# https://docs.fastlane.tools/plugins/available-plugins -# - -# Uncomment the line if you want fastlane to automatically update itself -# update_fastlane default_platform(:ios) @@ -30,11 +16,6 @@ platform :ios do ) end - desc "Build app for ad-hoc distribution" - lane :build_app_adhoc do - build_app_with_provisioning(distribution_type: "adhoc", export_method: "ad-hoc", configuration: "Release") - end - desc <<~DOC Create a temporary keychain for CI builds and expose its credentials to the environment. @@ -48,7 +29,7 @@ platform :ios do - Creates and unlocks the keychain. - Exposes keychain_name and keychain_password for reuse in other lanes (e.g., match/gym). DOC - lane :setup_temp_keychain do + private_lane :setup_temp_keychain do keychain_name = "app-signing" keychain_password = ENV["KEYCHAIN_PASSWORD"] @@ -78,7 +59,7 @@ platform :ios do Environment: - KEYCHAIN_PASSWORD must be set to the keychain’s password. DOC - lane :unlock_temp_keychain do + private_lane :unlock_temp_keychain do unlock_keychain( path: "app-signing", password: ENV['KEYCHAIN_PASSWORD'], @@ -87,78 +68,7 @@ platform :ios do end desc "Delete temp signing keychain" - lane :delete_temp_keychain do + private_lane :delete_temp_keychain do delete_keychain(name: "app-signing") end - - desc <<~DOC - Complete build process for app distribution. - - This lane combines provisioning setup and app building into a single workflow. - It first sets up the necessary code signing certificates and provisioning profiles, - then builds and exports the app as an IPA ready for distribution. - - Parameters: - distribution_type - Type of distribution for provisioning: "adhoc" or "development" (default: "adhoc") - export_method - Export method for build: "ad-hoc" or "development" (default: "ad-hoc") - configuration - The configuration from the Xcode project setup: "Release", "Debug" - - Environment Variables: - APP_IDENTIFIER - Bundle identifier for the app - APP_SCHEME - Xcode scheme to build - IPA_FILE - Output name for the generated IPA file (without extension) - MATCH_GIT_URL - Git URL for the match certificates repository - DOC - lane :build_app_with_provisioning do |options| - distribution_type = options[:distribution_type] - export_method = options[:export_method] - configuration = options[:configuration] - - setup_temp_keychain - unlock_temp_keychain - download_profiles - build_app_match(export_method: export_method, configuration: configuration) - ensure - # Always clean up - delete_temp_keychain - end - - desc <<~DOC - Build and export app as an IPA. - - This lane compiles the specified app scheme, archives it, and exports it as an IPA file - ready for distribution. The build includes cleaning and detailed logging for debugging. - - Parameters: - export_method - Export method: "ad-hoc" or "development" (default: "ad-hoc") - configuration - The configuration from the Xcode project setup: "Release", "Debug" - - Environment Variables: - APP_SCHEME - Xcode scheme to build - IPA_FILE - Output name for the generated IPA file (without extension) - DOC - lane :build_app_match do |options| - scheme = ENV["APP_SCHEME"] - ipaFile = ENV["IPA_FILE"] - export_method = options[:export_method] - configuration = options[:configuration] - - # Skip confirmation for development builds in CI - if export_method == "development" - ENV["FASTLANE_SKIP_WAITING_FOR_BUILD_PROCESSING"] = "true" - puts "⚠️ Skipping waiting for build processing (development build)" - end - gym( - scheme: scheme, - export_method: export_method, - configuration: configuration, - silent: false, - clean: true, - export_options: { - manageAppVersionAndBuildNumber: false - }, - export_team_id: "JA825X8F7Z", - output_name: ipaFile - ) - end end \ No newline at end of file From 3b57f96db9f0cc1151cba30dc14d036d085af506 Mon Sep 17 00:00:00 2001 From: Lester Batres Date: Tue, 30 Sep 2025 21:06:52 +0200 Subject: [PATCH 089/110] ci: Remove unneeded step. PP-1810 --- ...rchant-sdk.publish.example.apps.firebase.yml | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml b/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml index db3ea058a6..2846f3b892 100644 --- a/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml +++ b/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml @@ -16,7 +16,7 @@ concurrency: jobs: upload-version: - #environment: firebase-manual-deploy + environment: firebase-manual-deploy runs-on: macos-latest steps: - name: Checkout repository @@ -34,21 +34,6 @@ jobs: ruby-version: '3.2.0' bundler-cache: true - - name: Setup Manual Signing for Xcode project - uses: maierj/fastlane-action@5a3b971aaa26776459bb26894d6c1a1a84a311a7 # v3.1.0 - with: - lane: 'setup_manual_signing' - options: > - { - "project_path":"MerchantSDK/GiniMerchantSDKExample/GiniMerchantSDKExample.xcodeproj", - "team_id":"JA825X8F7Z", - "target":"GiniMerchantSDKExample", - "bundle_identifier": "net.gini.merchantsdk.example", - "profile_name": "match AdHoc net.gini.merchantsdk.example", - "entitlements_file_path": "GiniMerchantSDKExample/GiniMerchantSDKExample.entitlements", - "ci": "true" - } - - name: Setup Credentials run: | sed -i '' \ From a3312d6837998f46bf438ebbfe03c4c4ce7b356e Mon Sep 17 00:00:00 2001 From: Lester Batres Date: Tue, 30 Sep 2025 21:13:20 +0200 Subject: [PATCH 090/110] ci: Set `manual_signing` configuration PP-1810 --- ...merchant-sdk.publish.example.apps.firebase.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml b/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml index 2846f3b892..29dcbc7535 100644 --- a/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml +++ b/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml @@ -34,6 +34,21 @@ jobs: ruby-version: '3.2.0' bundler-cache: true + - name: Setup Manual Signing for Xcode project + uses: maierj/fastlane-action@5a3b971aaa26776459bb26894d6c1a1a84a311a7 # v3.1.0 + with: + lane: 'setup_manual_signing' + options: > + { + "project_path":"MerchantSDK/GiniMerchantSDKExample/GiniMerchantSDKExample.xcodeproj", + "team_id":"JA825X8F7Z", + "target":"GiniMerchantSDKExample", + "bundle_identifier": "net.gini.merchantsdk.example", + "profile_name": "match AdHoc net.gini.merchantsdk.example", + "entitlements_file_path": "GiniMerchantSDKExample/GiniMerchantSDKExample.entitlements", + "ci": "true" + } + - name: Setup Credentials run: | sed -i '' \ From 48a45f9e18d134d1731abf43293d174373932f0d Mon Sep 17 00:00:00 2001 From: Lester Batres Date: Wed, 1 Oct 2025 11:23:55 +0200 Subject: [PATCH 091/110] ci: Add `constants.yml` file to import shared values to needed workflows. PP-1810 --- .github/workflows/constants.yml | 23 +++++++++++++++++++ ...hant-sdk.publish.example.apps.firebase.yml | 22 ++++++++++-------- 2 files changed, 36 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/constants.yml diff --git a/.github/workflows/constants.yml b/.github/workflows/constants.yml new file mode 100644 index 0000000000..2e6ad1d200 --- /dev/null +++ b/.github/workflows/constants.yml @@ -0,0 +1,23 @@ +name: Workflow constants + +on: + workflow_call: + outputs: + merchant_project_path: + value: "MerchantSDK/GiniMerchantSDKExample/GiniMerchantSDKExample.xcodeproj" + merchant_target_name: + value: "GiniMerchantSDKExample" + merchant_bundle_id: + value: "net.gini.merchantsdk.example" + merchant_profile_name: + value: "match AdHoc net.gini.merchantsdk.example" + merchant_entitlements_path: + value: "GiniMerchantSDKExample/GiniMerchantSDKExample.entitlements" + team_id: + value: "JA825X8F7Z" + +jobs: + load_constants: + runs-on: ubuntu-latest + steps: + - run: echo "Constants loaded" \ No newline at end of file diff --git a/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml b/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml index 29dcbc7535..b4412fe177 100644 --- a/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml +++ b/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml @@ -15,8 +15,12 @@ concurrency: cancel-in-progress: ${{ !contains(github.ref, 'refs/tags/')}} jobs: + load_constants: + uses: ./.github/workflows/constants.yml + upload-version: environment: firebase-manual-deploy + needs: load_constants runs-on: macos-latest steps: - name: Checkout repository @@ -40,12 +44,12 @@ jobs: lane: 'setup_manual_signing' options: > { - "project_path":"MerchantSDK/GiniMerchantSDKExample/GiniMerchantSDKExample.xcodeproj", - "team_id":"JA825X8F7Z", - "target":"GiniMerchantSDKExample", - "bundle_identifier": "net.gini.merchantsdk.example", - "profile_name": "match AdHoc net.gini.merchantsdk.example", - "entitlements_file_path": "GiniMerchantSDKExample/GiniMerchantSDKExample.entitlements", + "project_path":"${{ needs.config.outputs.merchant_project_path }}", + "team_id":"${{ needs.config.outputs.team_id }}", + "target":"${{ needs.config.outputs.merchant_target_name }}", + "bundle_identifier": "${{ needs.config.outputs.merchant_bundle_id }}", + "profile_name": "${{ needs.config.outputs.merchant_profile_name }}", + "entitlements_file_path": "${{ needs.config.outputs.merchant_entitlements_path }}", "ci": "true" } @@ -59,13 +63,13 @@ jobs: - name: Archiving project uses: maierj/fastlane-action@5a3b971aaa26776459bb26894d6c1a1a84a311a7 # v3.1.0 env: - APP_IDENTIFIER: net.gini.merchantsdk.example + APP_IDENTIFIER: ${{ needs.config.outputs.merchant_bundle_id }} DISTRIBUTION_TYPE: adhoc GIT_URL: ${{ secrets.MATCH_GIT_URL }} MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} - APP_SCHEME: GiniMerchantSDKExample - IPA_FILE: GiniMerchantSDKExample + APP_SCHEME: ${{ needs.config.outputs.merchant_target_name }} + IPA_FILE: ${{ needs.config.outputs.merchant_target_name }} with: lane: 'build_app_adhoc' From 195aeb1f7f876dad3ab67454b59e9b90daf32a8f Mon Sep 17 00:00:00 2001 From: Lester Batres Date: Wed, 1 Oct 2025 11:34:27 +0200 Subject: [PATCH 092/110] ci: Add `constants.yml` file to import shared values to needed workflows. PP-1810 --- .github/workflows/constants.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/constants.yml b/.github/workflows/constants.yml index 2e6ad1d200..22fc2bceaa 100644 --- a/.github/workflows/constants.yml +++ b/.github/workflows/constants.yml @@ -18,6 +18,6 @@ on: jobs: load_constants: - runs-on: ubuntu-latest + runs-on: macos-latest steps: - run: echo "Constants loaded" \ No newline at end of file From 880c46a69e77eb4fd61c04bcff502b8936c127b9 Mon Sep 17 00:00:00 2001 From: Lester Batres Date: Wed, 1 Oct 2025 12:42:11 +0200 Subject: [PATCH 093/110] ci: Add `constants.yml` file to import shared values to needed workflows. PP-1810 --- .github/workflows/constants.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/constants.yml b/.github/workflows/constants.yml index 22fc2bceaa..2e6ad1d200 100644 --- a/.github/workflows/constants.yml +++ b/.github/workflows/constants.yml @@ -18,6 +18,6 @@ on: jobs: load_constants: - runs-on: macos-latest + runs-on: ubuntu-latest steps: - run: echo "Constants loaded" \ No newline at end of file From 5c31e1dc8e5e45092e29e4313ede766bdff371db Mon Sep 17 00:00:00 2001 From: Lester Batres Date: Wed, 1 Oct 2025 12:52:30 +0200 Subject: [PATCH 094/110] ci: Add `constants.yml` file to import shared values to needed workflows. PP-1810 --- .github/workflows/constants.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/constants.yml b/.github/workflows/constants.yml index 2e6ad1d200..22fc2bceaa 100644 --- a/.github/workflows/constants.yml +++ b/.github/workflows/constants.yml @@ -18,6 +18,6 @@ on: jobs: load_constants: - runs-on: ubuntu-latest + runs-on: macos-latest steps: - run: echo "Constants loaded" \ No newline at end of file From 32a73cd58a542eb7b24df7da2339ce24b8ed860b Mon Sep 17 00:00:00 2001 From: Lester Batres Date: Wed, 1 Oct 2025 13:44:18 +0200 Subject: [PATCH 095/110] ci: Add `github vars` to import shared values to needed workflows. PP-1810 --- .github/workflows/constants.yml | 23 ------------------- ...hant-sdk.publish.example.apps.firebase.yml | 20 +++++++--------- 2 files changed, 8 insertions(+), 35 deletions(-) delete mode 100644 .github/workflows/constants.yml diff --git a/.github/workflows/constants.yml b/.github/workflows/constants.yml deleted file mode 100644 index 22fc2bceaa..0000000000 --- a/.github/workflows/constants.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Workflow constants - -on: - workflow_call: - outputs: - merchant_project_path: - value: "MerchantSDK/GiniMerchantSDKExample/GiniMerchantSDKExample.xcodeproj" - merchant_target_name: - value: "GiniMerchantSDKExample" - merchant_bundle_id: - value: "net.gini.merchantsdk.example" - merchant_profile_name: - value: "match AdHoc net.gini.merchantsdk.example" - merchant_entitlements_path: - value: "GiniMerchantSDKExample/GiniMerchantSDKExample.entitlements" - team_id: - value: "JA825X8F7Z" - -jobs: - load_constants: - runs-on: macos-latest - steps: - - run: echo "Constants loaded" \ No newline at end of file diff --git a/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml b/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml index b4412fe177..867b925d38 100644 --- a/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml +++ b/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml @@ -15,12 +15,8 @@ concurrency: cancel-in-progress: ${{ !contains(github.ref, 'refs/tags/')}} jobs: - load_constants: - uses: ./.github/workflows/constants.yml - upload-version: environment: firebase-manual-deploy - needs: load_constants runs-on: macos-latest steps: - name: Checkout repository @@ -44,12 +40,12 @@ jobs: lane: 'setup_manual_signing' options: > { - "project_path":"${{ needs.config.outputs.merchant_project_path }}", - "team_id":"${{ needs.config.outputs.team_id }}", - "target":"${{ needs.config.outputs.merchant_target_name }}", - "bundle_identifier": "${{ needs.config.outputs.merchant_bundle_id }}", - "profile_name": "${{ needs.config.outputs.merchant_profile_name }}", - "entitlements_file_path": "${{ needs.config.outputs.merchant_entitlements_path }}", + "project_path":"${{ vars.MERCHANT_PROJECT_PATH }}", + "team_id":"${{ vars.TEAM_ID }}", + "target":"${{ vars.MERCHANT_TARGET_NAME }}", + "bundle_identifier": "${{ vars.MERCHANT_BUNDLE_ID }}", + "profile_name": "${{ vars.MERCHANT_PROFILE_NAME }}", + "entitlements_file_path": "${{ vars.MERCHANT_ENTITLEMENTS_PATH }}", "ci": "true" } @@ -68,8 +64,8 @@ jobs: GIT_URL: ${{ secrets.MATCH_GIT_URL }} MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} - APP_SCHEME: ${{ needs.config.outputs.merchant_target_name }} - IPA_FILE: ${{ needs.config.outputs.merchant_target_name }} + APP_SCHEME: ${{ vars.MERCHANT_TARGET_NAME }} + IPA_FILE: ${{ vars.MERCHANT_TARGET_NAME }} with: lane: 'build_app_adhoc' From 6beee1dc0ecfba4db210354e8fa041e8955e6921 Mon Sep 17 00:00:00 2001 From: Lester Batres Date: Wed, 1 Oct 2025 14:03:05 +0200 Subject: [PATCH 096/110] ci: Add `github vars` to import shared values to needed workflows. PP-1810 --- .../workflows/merchant-sdk.publish.example.apps.firebase.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml b/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml index 867b925d38..c3684f58d4 100644 --- a/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml +++ b/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml @@ -59,7 +59,7 @@ jobs: - name: Archiving project uses: maierj/fastlane-action@5a3b971aaa26776459bb26894d6c1a1a84a311a7 # v3.1.0 env: - APP_IDENTIFIER: ${{ needs.config.outputs.merchant_bundle_id }} + APP_IDENTIFIER: ${{ vars.MERCHANT_BUNDLE_ID }} DISTRIBUTION_TYPE: adhoc GIT_URL: ${{ secrets.MATCH_GIT_URL }} MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} From 2abbf164651636fec6913558f3a4b8432e2c926e Mon Sep 17 00:00:00 2001 From: Lester Batres Date: Wed, 1 Oct 2025 14:30:55 +0200 Subject: [PATCH 097/110] ci: Update `health-sdk.publish.example.apps.firebase.yml` to use `Fastlane` and remove the manual profiles and archiving. PP-1810 --- ...alth-sdk.publish.example.apps.firebase.yml | 76 +++++-------------- 1 file changed, 17 insertions(+), 59 deletions(-) diff --git a/.github/workflows/health-sdk.publish.example.apps.firebase.yml b/.github/workflows/health-sdk.publish.example.apps.firebase.yml index 9ad00b3f00..b1c13118c8 100644 --- a/.github/workflows/health-sdk.publish.example.apps.firebase.yml +++ b/.github/workflows/health-sdk.publish.example.apps.firebase.yml @@ -29,35 +29,6 @@ jobs: with: xcode-version: '16.4' - - name: Setup provisioning profile - env: - BUILD_CERTIFICATE_BASE64: ${{ secrets.GINI_DISTRIBUTION_CERTIFICATE }} - P12_PASSWORD: ${{ secrets.GINI_DISTRIBUTION_CERTIFICATE_SECRET }} - BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.GINI_HEALTH_SDK_EXAMPLE_APP_ADHOC_DISTRIBUTION_PROVISION_PROFILE }} - KEYCHAIN_PASSWORD: ${{ secrets.GINI_DISTRIBUTION_CERTIFICATE_SECRET }} - run: | - CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 - PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision - - KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db - - # import certificate and provisioning profile from secrets - echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH - echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode --output $PP_PATH - - # create temporary keychain - security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH - security set-keychain-settings -lut 21600 $KEYCHAIN_PATH - security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH - - # import certificate to keychain - security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH - security list-keychain -d user -s $KEYCHAIN_PATH - - # apply provisioning profile - mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles - cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles - - name: Setup Manual Signing for Xcode project uses: ruby/setup-ruby@dffc446db9ba5a0c4446edb5bca1c5c473a806c5 # v1.245.0 with: @@ -68,12 +39,12 @@ jobs: lane: 'setup_manual_signing' options: > { - "project_path":"HealthSDK/GiniHealthSDKExample/GiniHealthSDKExample.xcodeproj", - "team_id":"JA825X8F7Z", - "target":"GiniHealthSDKExample", - "bundle_identifier": "net.gini.healthsdk.example", - "profile_name": "Gini Health SDK Example App Ad-Hoc Distribution", - "entitlements_file_path": "GiniHealthSDKExample/GiniHealthSDKExample.entitlements", + "project_path":"${{ vars.HEALTH_PROJECT_PATH }}", + "team_id":"${{ vars.TEAM_ID }}", + "target":"${{ vars.HEALTH_TARGET_NAME }}", + "bundle_identifier": "${{ vars.HEALTH_BUNDLE_ID }}", + "profile_name": "${{ vars.HEALTH_PROFILE_NAME }}", + "entitlements_file_path": "${{ vars.HEALTH_ENTITLEMENTS_PATH }}", "ci": "true" } @@ -89,30 +60,17 @@ jobs: plutil -replace API_KEY -string "${{ secrets.FIREBASE_API_KEY }}" HealthSDK/GiniHealthSDKExample/GoogleService-Info.plist - name: Archiving project - run: | - xcodebuild clean archive \ - -workspace GiniMobile.xcworkspace \ - -scheme "GiniHealthSDKExample" \ - -archivePath ./GiniHealthSDKExample.xcarchive \ - -configuration Release \ - -destination generic/platform=iOS \ - CODE_SIGN_IDENTITY="Apple Distribution" \ - CODE_SIGNING_REQUIRED=NO \ - ONLY_ACTIVE_ARCH=NO \ - CODE_SIGN_STYLE=Manual \ - DEVELOPMENT_TEAM=JA825X8F7Z - - - name: Exporting .ipa - run: | - xcodebuild \ - -exportArchive \ - -archivePath GiniHealthSDKExample.xcarchive \ - -exportPath . \ - -exportOptionsPlist ExportOptionsHealthExample.plist \ - -destination "generic/platform=iOS" \ - CODE_SIGNING_REQUIRED=YES \ - ONLY_ACTIVE_ARCH=NO \ - CODE_SIGN_STYLE=Manual + uses: maierj/fastlane-action@5a3b971aaa26776459bb26894d6c1a1a84a311a7 # v3.1.0 + env: + APP_IDENTIFIER: ${{ vars.MERCHANT_BUNDLE_ID }} + DISTRIBUTION_TYPE: adhoc + GIT_URL: ${{ secrets.MATCH_GIT_URL }} + MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} + KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} + APP_SCHEME: ${{ vars.HEALTH_TARGET_NAME }} + IPA_FILE: ${{ vars.HEALTH_TARGET_NAME }} + with: + lane: 'build_app_adhoc' - name: Check file existence uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0 From bbf7a8088db4748d778e2613c327ab162f9e1bd4 Mon Sep 17 00:00:00 2001 From: Lester Batres Date: Wed, 1 Oct 2025 14:40:17 +0200 Subject: [PATCH 098/110] ci: Fix app identifier. PP-1810 --- .github/workflows/health-sdk.publish.example.apps.firebase.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/health-sdk.publish.example.apps.firebase.yml b/.github/workflows/health-sdk.publish.example.apps.firebase.yml index b1c13118c8..0558d1c851 100644 --- a/.github/workflows/health-sdk.publish.example.apps.firebase.yml +++ b/.github/workflows/health-sdk.publish.example.apps.firebase.yml @@ -10,7 +10,6 @@ on: - 'GiniComponents/**' workflow_dispatch: - concurrency: group: ${{ github.workflow }}-${{ github.ref }}-publish cancel-in-progress: ${{ !contains(github.ref, 'refs/tags/')}} @@ -62,7 +61,7 @@ jobs: - name: Archiving project uses: maierj/fastlane-action@5a3b971aaa26776459bb26894d6c1a1a84a311a7 # v3.1.0 env: - APP_IDENTIFIER: ${{ vars.MERCHANT_BUNDLE_ID }} + APP_IDENTIFIER: ${{ vars.HEALTH_BUNDLE_ID }} DISTRIBUTION_TYPE: adhoc GIT_URL: ${{ secrets.MATCH_GIT_URL }} MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} From 2175376edd50b0555d7c55e7e6ab6a36434a5d01 Mon Sep 17 00:00:00 2001 From: Lester Batres Date: Wed, 1 Oct 2025 14:52:51 +0200 Subject: [PATCH 099/110] feat(GiniHealthSDKExmple): Update signing configuration to use `fastlane match profiles` --- .../GiniHealthSDKExample.xcodeproj/project.pbxproj | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/HealthSDK/GiniHealthSDKExample/GiniHealthSDKExample.xcodeproj/project.pbxproj b/HealthSDK/GiniHealthSDKExample/GiniHealthSDKExample.xcodeproj/project.pbxproj index f312b5fa01..614c1424d7 100644 --- a/HealthSDK/GiniHealthSDKExample/GiniHealthSDKExample.xcodeproj/project.pbxproj +++ b/HealthSDK/GiniHealthSDKExample/GiniHealthSDKExample.xcodeproj/project.pbxproj @@ -700,8 +700,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = GiniHealthSDKExample/GiniHealthSDKExample.entitlements; - CODE_SIGN_IDENTITY = "Apple Distribution"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Distribution: Gini GmbH (JA825X8F7Z)"; + CODE_SIGN_IDENTITY = "iPhone Distribution: Gini GmbH (JA825X8F7Z)"; CODE_SIGN_STYLE = Manual; DEVELOPMENT_TEAM = JA825X8F7Z; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = JA825X8F7Z; @@ -728,7 +727,7 @@ PRODUCT_BUNDLE_IDENTIFIER = net.gini.healthsdk.example; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; - "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Gini Health SDK Example App App Store Distribution"; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match AppStore net.gini.healthsdk.example"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; From 1a54a8be27df38f04611df99b720a8e29f04e26b Mon Sep 17 00:00:00 2001 From: Lester Batres Date: Thu, 2 Oct 2025 10:14:22 +0200 Subject: [PATCH 100/110] ci: Update `bank-sdk.publish.example.app.firebase.yml` to use `Fastlane` and remove the manual profiles and archiving. PP-1810 --- .../bank-sdk.publish.example.app.firebase.yml | 88 +++++-------------- .../project.pbxproj | 2 +- 2 files changed, 22 insertions(+), 68 deletions(-) diff --git a/.github/workflows/bank-sdk.publish.example.app.firebase.yml b/.github/workflows/bank-sdk.publish.example.app.firebase.yml index 0f02a00378..52b9f28d27 100644 --- a/.github/workflows/bank-sdk.publish.example.app.firebase.yml +++ b/.github/workflows/bank-sdk.publish.example.app.firebase.yml @@ -28,39 +28,6 @@ jobs: with: xcode-version: '16.4' - - name: Setup provisioning profile - env: - BUILD_CERTIFICATE_BASE64: ${{ secrets.GINI_DISTRIBUTION_CERTIFICATE }} - P12_PASSWORD: ${{ secrets.GINI_DISTRIBUTION_CERTIFICATE_SECRET }} - BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.GINI_BANK_SDK_EXAMPLE_ADHOC_DISTRIBUTION_PROVISION_PROFILE }} - BUILD_PROVISION_PROFILE_EXTENSION_BASE64: ${{ secrets.GINI_BANK_SDK_EXTENSION_ADHOC_DISTRIBUTION_PROVISION_PROFILE }} - KEYCHAIN_PASSWORD: ${{ secrets.GINI_DISTRIBUTION_CERTIFICATE_SECRET }} - run: | - CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 - PP_PATH1=$RUNNER_TEMP/build_pp1.mobileprovision - PP_PATH2=$RUNNER_TEMP/build_pp2.mobileprovision - - KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db - - # import certificate and provisioning profile from secrets - echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH - echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode --output $PP_PATH1 - echo -n "$BUILD_PROVISION_PROFILE_EXTENSION_BASE64" | base64 --decode --output $PP_PATH2 - - # create temporary keychain - security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH - security set-keychain-settings -lut 21600 $KEYCHAIN_PATH - security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH - - # import certificate to keychain - security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH - security list-keychain -d user -s $KEYCHAIN_PATH - - # apply provisioning profile - mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles - cp $PP_PATH1 ~/Library/MobileDevice/Provisioning\ Profiles - cp $PP_PATH2 ~/Library/MobileDevice/Provisioning\ Profiles - - name: Setup Manual Signing for Xcode project uses: ruby/setup-ruby@dffc446db9ba5a0c4446edb5bca1c5c473a806c5 # v1.245.0 with: @@ -71,16 +38,16 @@ jobs: lane: 'setup_manual_signing' options: > { - "project_path":"BankSDK/GiniBankSDKExample/GiniBankSDKExample.xcodeproj", - "team_id":"JA825X8F7Z", - "target":"GiniBankSDKExample", - "target_extension": "GiniBankSDKShareExtension", - "bundle_identifier": "net.gini.banksdk.example", - "bundle_identifier_extension": "net.gini.banksdk.example.ShareExtension", - "profile_name": "Gini Bank SDK Example App Ad-Hoc Distribution", - "profile_name_extension" : "Gini Bank SDK Share Extension Ad-Hoc Distribution", - "entitlements_file_path": "GiniBankSDKExample/Example Swift.entitlements", - "entitlements_file_path_extension": "GiniBankSDKShareExtension/GiniBankSDKShareExtension.entitlements", + "project_path":"${{ vars.BANK_PROJECT_PATH }}", + "team_id":"${{ vars.TEAM_ID }}", + "target":"${{ vars.BANK_TARGET_NAME }}", + "target_extension":"${{ vars.BANK_EXTENSION_TARGET_NAME }}", + "bundle_identifier": "${{ vars.BANK_BUNDLE_ID }}", + "bundle_identifier_extension": "${{ vars.BANK_EXTENSION_BUNDLE_ID }}", + "profile_name": "${{ vars.BANK_PROFILE_NAME }}", + "profile_name_extension": "${{ vars.BANK_EXTENSION_PROFILE_NAME }}", + "entitlements_file_path": "${{ vars.BANK_ENTITLEMENTS_PATH }}", + "entitlements_file_path_extension": "${{ vars.BANK_EXTENSION_ENTITLEMENTS_PATH }}", "ci": "true" } @@ -94,30 +61,17 @@ jobs: plutil -replace API_KEY -string "${{ secrets.FIREBASE_API_KEY }}" BankSDK/GiniBankSDKExample/GoogleService-Info.plist - name: Archiving project - run: | - xcodebuild clean archive \ - -workspace GiniMobile.xcworkspace \ - -scheme "GiniBankSDKExample" \ - -archivePath ./GiniBankSDKExample.xcarchive \ - -configuration Release \ - -destination generic/platform=iOS \ - CODE_SIGN_IDENTITY="Apple Distribution" \ - CODE_SIGNING_REQUIRED=NO \ - ONLY_ACTIVE_ARCH=NO \ - CODE_SIGN_STYLE=Manual \ - DEVELOPMENT_TEAM=JA825X8F7Z - - - name: Exporting .ipa - run: | - xcodebuild \ - -exportArchive \ - -archivePath GiniBankSDKExample.xcarchive \ - -exportPath . \ - -exportOptionsPlist ExportOptions.plist \ - -destination "generic/platform=iOS" \ - CODE_SIGNING_REQUIRED=YES \ - ONLY_ACTIVE_ARCH=NO \ - CODE_SIGN_STYLE=Manual + uses: maierj/fastlane-action@5a3b971aaa26776459bb26894d6c1a1a84a311a7 # v3.1.0 + env: + APP_IDENTIFIER: ${{ vars.HEALTH_BUNDLE_ID }} + DISTRIBUTION_TYPE: adhoc + GIT_URL: ${{ secrets.MATCH_GIT_URL }} + MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} + KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} + APP_SCHEME: ${{ vars.HEALTH_TARGET_NAME }} + IPA_FILE: ${{ vars.HEALTH_TARGET_NAME }} + with: + lane: 'build_app_adhoc' - name: Check file existence uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0 diff --git a/BankSDK/GiniBankSDKExample/GiniBankSDKExample.xcodeproj/project.pbxproj b/BankSDK/GiniBankSDKExample/GiniBankSDKExample.xcodeproj/project.pbxproj index e3112e911c..a7fee33519 100644 --- a/BankSDK/GiniBankSDKExample/GiniBankSDKExample.xcodeproj/project.pbxproj +++ b/BankSDK/GiniBankSDKExample/GiniBankSDKExample.xcodeproj/project.pbxproj @@ -2582,7 +2582,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = ""; CODE_SIGN_ENTITLEMENTS = "GiniBankSDKExample/Example Swift.entitlements"; - CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_IDENTITY = "iPhone Distribution: Gini GmbH (JA825X8F7Z)"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; DEVELOPMENT_TEAM = ""; From 1a8f7464e5af92dfe4dd57b026d314c9f83114c2 Mon Sep 17 00:00:00 2001 From: Lester Batres Date: Thu, 2 Oct 2025 10:21:26 +0200 Subject: [PATCH 101/110] ci: Update `bank-sdk.publish.example.app.firebase.yml` to use `Fastlane` and remove the manual profiles and archiving. PP-1810 --- .github/workflows/bank-sdk.publish.example.app.firebase.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/bank-sdk.publish.example.app.firebase.yml b/.github/workflows/bank-sdk.publish.example.app.firebase.yml index 52b9f28d27..98cca2fa5e 100644 --- a/.github/workflows/bank-sdk.publish.example.app.firebase.yml +++ b/.github/workflows/bank-sdk.publish.example.app.firebase.yml @@ -63,13 +63,13 @@ jobs: - name: Archiving project uses: maierj/fastlane-action@5a3b971aaa26776459bb26894d6c1a1a84a311a7 # v3.1.0 env: - APP_IDENTIFIER: ${{ vars.HEALTH_BUNDLE_ID }} + APP_IDENTIFIER: ${{ vars.BANK_BUNDLE_ID }} DISTRIBUTION_TYPE: adhoc GIT_URL: ${{ secrets.MATCH_GIT_URL }} MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} - APP_SCHEME: ${{ vars.HEALTH_TARGET_NAME }} - IPA_FILE: ${{ vars.HEALTH_TARGET_NAME }} + APP_SCHEME: ${{ vars.BANK_TARGET_NAME }} + IPA_FILE: ${{ vars.BANK_TARGET_NAME }} with: lane: 'build_app_adhoc' From 27480edaab3ddc941ab518bc89bd85122c249adc Mon Sep 17 00:00:00 2001 From: Lester Batres Date: Thu, 2 Oct 2025 11:04:54 +0200 Subject: [PATCH 102/110] ci: Update `bank-sdk.publish.example.app.firebase.yml` to use `Fastlane` and remove the manual profiles and archiving. PP-1810 --- .github/workflows/bank-sdk.publish.example.app.firebase.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bank-sdk.publish.example.app.firebase.yml b/.github/workflows/bank-sdk.publish.example.app.firebase.yml index 98cca2fa5e..487419160f 100644 --- a/.github/workflows/bank-sdk.publish.example.app.firebase.yml +++ b/.github/workflows/bank-sdk.publish.example.app.firebase.yml @@ -63,7 +63,7 @@ jobs: - name: Archiving project uses: maierj/fastlane-action@5a3b971aaa26776459bb26894d6c1a1a84a311a7 # v3.1.0 env: - APP_IDENTIFIER: ${{ vars.BANK_BUNDLE_ID }} + APP_IDENTIFIER: ${{ vars.BANK_BUNDLE_IDS }} DISTRIBUTION_TYPE: adhoc GIT_URL: ${{ secrets.MATCH_GIT_URL }} MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} From f670c7eb3d1408a530498615fa995599bd5490b9 Mon Sep 17 00:00:00 2001 From: Lester Batres Date: Thu, 2 Oct 2025 14:24:03 +0200 Subject: [PATCH 103/110] ci: Update `health-sdk.build.xcframeworks.yml` to use `Fastlane` and remove the manual profiles. PP-1810 --- .../health-sdk.build.xcframeworks.yml | 53 ++++++++----------- fastlane/Fastfile_archiving | 2 - fastlane/Fastfile_signing | 3 ++ 3 files changed, 25 insertions(+), 33 deletions(-) diff --git a/.github/workflows/health-sdk.build.xcframeworks.yml b/.github/workflows/health-sdk.build.xcframeworks.yml index b6a37fa6c0..4980c7c8e0 100644 --- a/.github/workflows/health-sdk.build.xcframeworks.yml +++ b/.github/workflows/health-sdk.build.xcframeworks.yml @@ -29,45 +29,36 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Setup Ruby + uses: ruby/setup-ruby@dffc446db9ba5a0c4446edb5bca1c5c473a806c5 # v1.245.0 + with: + ruby-version: '3.2.0' + bundler-cache: true + - name: Archiving project and creating XCFrameworks run: | ./build-healthsdk.sh + + - name: Download profiles + uses: maierj/fastlane-action@5a3b971aaa26776459bb26894d6c1a1a84a311a7 # v3.1.0 + env: + APP_IDENTIFIER: ${{ vars.HEALTH_BUNDLE_ID }} + DISTRIBUTION_TYPE: adhoc + GIT_URL: ${{ secrets.MATCH_GIT_URL }} + MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} + KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} + with: + lane: 'download_profiles' - name: Sign the XCFrameworks env: - BUILD_CERTIFICATE_BASE64: ${{ secrets.GINI_DISTRIBUTION_CERTIFICATE }} - P12_PASSWORD: ${{ secrets.GINI_DISTRIBUTION_CERTIFICATE_SECRET }} - BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.GINI_HEALTH_SDK_EXAMPLE_APP_ADHOC_DISTRIBUTION_PROVISION_PROFILE }} - KEYCHAIN_PASSWORD: ${{ secrets.GINI_DISTRIBUTION_CERTIFICATE_SECRET }} + KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} run: | - # Setup distribution certificate - CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 - PP_PATH1=$RUNNER_TEMP/build_pp1.mobileprovision - - KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db - - # import certificate and provisioning profile from secrets - echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH - echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH1 - - # create temporary keychain - security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH - security set-keychain-settings -lut 21600 $KEYCHAIN_PATH - security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH - - # import certificate to keychain - security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH - security list-keychain -d user -s $KEYCHAIN_PATH - - # apply provisioning profile - mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles - cp $PP_PATH1 ~/Library/MobileDevice/Provisioning\ Profiles - # sign xcframeworks - codesign --timestamp -v --sign "Apple Distribution: Gini GmbH (JA825X8F7Z)" GiniHealthAPILibrary.xcframework && \ - codesign --timestamp -v --sign "Apple Distribution: Gini GmbH (JA825X8F7Z)" GiniHealthSDK.xcframework && \ - codesign --timestamp -v --sign "Apple Distribution: Gini GmbH (JA825X8F7Z)" GiniInternalPaymentSDK.xcframework && \ - codesign --timestamp -v --sign "Apple Distribution: Gini GmbH (JA825X8F7Z)" GiniUtilites.xcframework + codesign --timestamp -v --sign "iPhone Distribution: Gini GmbH (JA825X8F7Z)" GiniHealthAPILibrary.xcframework && \ + codesign --timestamp -v --sign "iPhone Distribution: Gini GmbH (JA825X8F7Z)" GiniHealthSDK.xcframework && \ + codesign --timestamp -v --sign "iPhone Distribution: Gini GmbH (JA825X8F7Z)" GiniInternalPaymentSDK.xcframework && \ + codesign --timestamp -v --sign "iPhone Distribution: Gini GmbH (JA825X8F7Z)" GiniUtilites.xcframework - name: archive frameworks GiniHealthAPILibrary uses: actions/upload-artifact@v4 diff --git a/fastlane/Fastfile_archiving b/fastlane/Fastfile_archiving index 8edb9ff33a..21ecff47bb 100644 --- a/fastlane/Fastfile_archiving +++ b/fastlane/Fastfile_archiving @@ -31,8 +31,6 @@ platform :ios do export_method = options[:export_method] configuration = options[:configuration] - setup_temp_keychain - unlock_temp_keychain download_profiles build_app_match(export_method: export_method, configuration: configuration) ensure diff --git a/fastlane/Fastfile_signing b/fastlane/Fastfile_signing index 3941840237..4c8a977e03 100644 --- a/fastlane/Fastfile_signing +++ b/fastlane/Fastfile_signing @@ -6,6 +6,9 @@ platform :ios do Download the provisioning profiles stored in the remote repository to be used in github actions DOC lane :download_profiles do + setup_temp_keychain + unlock_temp_keychain + match( app_identifier: ENV["APP_IDENTIFIER"], type: ENV["DISTRIBUTION_TYPE"], From d497dcb44fa8300ea7ef1ef7e493272a83d823bb Mon Sep 17 00:00:00 2001 From: Valentina Iancu Date: Thu, 2 Oct 2025 14:43:07 +0200 Subject: [PATCH 104/110] ci: Update fastlane --- Gemfile.lock | 72 ++++++++++++++++++++++++++++------------------------ 1 file changed, 39 insertions(+), 33 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 7c34861091..4d42f41347 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -17,24 +17,28 @@ GEM json (>= 1.5.1) artifactory (3.0.17) atomos (0.1.3) - aws-eventstream (1.3.0) - aws-partitions (1.992.0) - aws-sdk-core (3.210.0) + aws-eventstream (1.4.0) + aws-partitions (1.1168.0) + aws-sdk-core (3.233.0) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.992.0) aws-sigv4 (~> 1.9) + base64 + bigdecimal jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.95.0) - aws-sdk-core (~> 3, >= 3.210.0) + logger + aws-sdk-kms (1.113.0) + aws-sdk-core (~> 3, >= 3.231.0) aws-sigv4 (~> 1.5) - aws-sdk-s3 (1.169.0) - aws-sdk-core (~> 3, >= 3.210.0) + aws-sdk-s3 (1.199.1) + aws-sdk-core (~> 3, >= 3.231.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.5) - aws-sigv4 (1.10.0) + aws-sigv4 (1.12.1) aws-eventstream (~> 1, >= 1.0.2) babosa (1.0.4) - base64 (0.2.0) + base64 (0.3.0) + bigdecimal (3.2.3) claide (1.1.0) cocoapods (1.12.1) addressable (~> 2.8) @@ -79,7 +83,7 @@ GEM highline (~> 2.0.0) concurrent-ruby (1.2.2) declarative (0.0.20) - digest-crc (0.6.5) + digest-crc (0.7.0) rake (>= 12.0.0, < 14.0.0) domain_name (0.6.20240107) dotenv (2.8.1) @@ -104,11 +108,11 @@ GEM faraday (>= 0.8.0) http-cookie (~> 1.0.0) faraday-em_http (1.0.0) - faraday-em_synchrony (1.0.0) + faraday-em_synchrony (1.0.1) faraday-excon (1.1.0) faraday-httpclient (1.0.1) - faraday-multipart (1.0.4) - multipart-post (~> 2) + faraday-multipart (1.1.1) + multipart-post (~> 2.0) faraday-net_http (1.0.2) faraday-net_http_persistent (1.2.0) faraday-patron (1.0.0) @@ -116,8 +120,8 @@ GEM faraday-retry (1.0.3) faraday_middleware (1.2.1) faraday (~> 1.0) - fastimage (2.3.1) - fastlane (2.225.0) + fastimage (2.4.0) + fastlane (2.228.0) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.8, < 3.0.0) artifactory (~> 3.0) @@ -157,7 +161,7 @@ GEM tty-spinner (>= 0.8.0, < 1.0.0) word_wrap (~> 1.0.0) xcodeproj (>= 1.13.0, < 2.0.0) - xcpretty (~> 0.3.0) + xcpretty (~> 0.4.1) xcpretty-travis-formatter (>= 0.0.3, < 2.0.0) fastlane-sirp (1.0.0) sysrandom (~> 1.0) @@ -202,9 +206,10 @@ GEM os (>= 0.9, < 2.0) signet (>= 0.16, < 2.a) highline (2.0.3) - http-cookie (1.0.7) + http-cookie (1.0.8) domain_name (~> 0.5) - httpclient (2.8.3) + httpclient (2.9.0) + mutex_m i18n (1.14.1) concurrent-ruby (~> 1.0) jazzy (0.14.3) @@ -218,10 +223,11 @@ GEM sqlite3 (~> 1.3) xcinvoke (~> 0.3.0) jmespath (1.6.2) - json (2.7.2) - jwt (2.9.3) + json (2.15.0) + jwt (2.10.2) base64 liferaft (0.0.6) + logger (1.7.0) mini_magick (4.13.2) mini_mime (1.1.5) mini_portile2 (2.8.5) @@ -230,28 +236,29 @@ GEM multi_json (1.15.0) multipart-post (2.4.1) mustache (1.1.1) - nanaimo (0.3.0) + mutex_m (0.3.0) + nanaimo (0.4.0) nap (1.1.0) - naturally (2.2.1) + naturally (2.3.0) netrc (0.11.0) nkf (0.2.0) open4 (1.3.4) - optparse (0.5.0) + optparse (0.6.0) os (1.1.4) - plist (3.7.1) + plist (3.7.2) public_suffix (4.0.7) - rake (13.2.1) + rake (13.3.0) redcarpet (3.6.0) representable (3.2.0) declarative (< 0.1.0) trailblazer-option (>= 0.1.1, < 0.2.0) uber (< 0.2.0) retriable (3.1.2) - rexml (3.4.2) - rouge (2.0.7) + rexml (3.4.4) + rouge (3.28.0) ruby-macho (2.5.1) ruby2_keywords (0.0.5) - rubyzip (2.3.2) + rubyzip (2.4.1) sassc (2.4.0) ffi (~> 1.9) security (0.1.5) @@ -265,7 +272,6 @@ GEM naturally sqlite3 (1.6.3) mini_portile2 (~> 2.8.0) - sqlite3 (1.6.3-arm64-darwin) sqlite3 (1.6.3-x86_64-darwin) sqlite3 (1.6.3-x86_64-linux) sysrandom (1.0.5) @@ -286,15 +292,15 @@ GEM word_wrap (1.0.0) xcinvoke (0.3.0) liferaft (~> 0.0.6) - xcodeproj (1.25.1) + xcodeproj (1.27.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) colored2 (~> 3.1) - nanaimo (~> 0.3.0) + nanaimo (~> 0.4.0) rexml (>= 3.3.6, < 4.0) - xcpretty (0.3.0) - rouge (~> 2.0.7) + xcpretty (0.4.1) + rouge (~> 3.28.0) xcpretty-travis-formatter (1.0.1) xcpretty (~> 0.2, >= 0.0.7) From 35f621e20de3c16f15f52698732a2a4f77dfd117 Mon Sep 17 00:00:00 2001 From: Lester Batres Date: Thu, 2 Oct 2025 15:05:34 +0200 Subject: [PATCH 105/110] ci: Remove `health-sdk.build.xcframeworks.xcode16.yml` since it is not needed anymore. PP-1810 --- .../health-sdk.build.xcframeworks.xcode16.yml | 81 ------------------- 1 file changed, 81 deletions(-) delete mode 100644 .github/workflows/health-sdk.build.xcframeworks.xcode16.yml diff --git a/.github/workflows/health-sdk.build.xcframeworks.xcode16.yml b/.github/workflows/health-sdk.build.xcframeworks.xcode16.yml deleted file mode 100644 index da5b5d3a57..0000000000 --- a/.github/workflows/health-sdk.build.xcframeworks.xcode16.yml +++ /dev/null @@ -1,81 +0,0 @@ -name: Build HealthSDK XCFrameworks XCode 16 -permissions: - contents: read -on: - push: - tags: - - 'GiniHealthSDK;[0-9]+.[0-9]+.[0-9]+;xcframeworks**' - - 'GiniHealthSDK;[0-9]+.[0-9]+.[0-9]+-beta[0-9][0-9]+;xcframeworks**' - workflow_dispatch: - workflow_call: - secrets: - BUILD_CERTIFICATE_BASE64: - required: true - P12_PASSWORD: - required: true - BUILD_PROVISION_PROFILE_BASE64: - required: true - KEYCHAIN_PASSWORD: - required: true -jobs: - prepare-frameworks: - name: Create Release - runs-on: macos-15 - steps: - - uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0 - with: - xcode-version: '16.4' - - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Archiving project and creating XCFrameworks - run: | - ./build-healthsdk.sh - - - name: Sign the XCFrameworks - env: - BUILD_CERTIFICATE_BASE64: ${{ secrets.GINI_DISTRIBUTION_CERTIFICATE }} - P12_PASSWORD: ${{ secrets.GINI_DISTRIBUTION_CERTIFICATE_SECRET }} - BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.GINI_HEALTH_SDK_EXAMPLE_APP_ADHOC_DISTRIBUTION_PROVISION_PROFILE }} - KEYCHAIN_PASSWORD: ${{ secrets.GINI_DISTRIBUTION_CERTIFICATE_SECRET }} - run: | - # Setup distribution certificate - CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 - PP_PATH1=$RUNNER_TEMP/build_pp1.mobileprovision - - KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db - - # import certificate and provisioning profile from secrets - echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH - echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH1 - - # create temporary keychain - security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH - security set-keychain-settings -lut 21600 $KEYCHAIN_PATH - security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH - - # import certificate to keychain - security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH - security list-keychain -d user -s $KEYCHAIN_PATH - - # apply provisioning profile - mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles - cp $PP_PATH1 ~/Library/MobileDevice/Provisioning\ Profiles - - # sign xcframeworks - codesign --timestamp -v --sign "Apple Distribution: Gini GmbH (JA825X8F7Z)" GiniHealthAPILibrary.xcframework && \ - codesign --timestamp -v --sign "Apple Distribution: Gini GmbH (JA825X8F7Z)" GiniHealthSDK.xcframework && \ - codesign --timestamp -v --sign "Apple Distribution: Gini GmbH (JA825X8F7Z)" GiniInternalPaymentSDK.xcframework && \ - codesign --timestamp -v --sign "Apple Distribution: Gini GmbH (JA825X8F7Z)" GiniUtilites.xcframework - - - name: archive frameworks GiniHealthAPILibrary - uses: actions/upload-artifact@v4 - with: - name: GiniHealthSDKFramework - path: | - GiniHealthAPILibrary.xcframework - GiniHealthSDK.xcframework - GiniInternalPaymentSDK.xcframework - GiniUtilites.xcframework - From 50984e05e073c0735879b845d1b7d5b478f99add Mon Sep 17 00:00:00 2001 From: Lester Batres Date: Thu, 2 Oct 2025 15:05:57 +0200 Subject: [PATCH 106/110] ci: Update `bank-sdk.build.xcframeworks.yml` to use `Fastlane` and remove the manual profiles. PP-1810 --- .../workflows/bank-sdk.build.xcframeworks.yml | 55 ++++++------------- .github/workflows/bank-sdk.release.yml | 6 +- 2 files changed, 19 insertions(+), 42 deletions(-) diff --git a/.github/workflows/bank-sdk.build.xcframeworks.yml b/.github/workflows/bank-sdk.build.xcframeworks.yml index d7e857059f..b2190c1db5 100644 --- a/.github/workflows/bank-sdk.build.xcframeworks.yml +++ b/.github/workflows/bank-sdk.build.xcframeworks.yml @@ -130,47 +130,28 @@ jobs: -framework iphonesimulatorPinning.xcarchive/Products/Library/Frameworks/TrustKit.framework \ -output TrustKit.xcframework + - name: Download profiles + uses: maierj/fastlane-action@5a3b971aaa26776459bb26894d6c1a1a84a311a7 # v3.1.0 + env: + APP_IDENTIFIER: ${{ vars.BANK_BUNDLE_IDS }} + DISTRIBUTION_TYPE: adhoc + GIT_URL: ${{ secrets.MATCH_GIT_URL }} + MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} + KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} + with: + lane: 'download_profiles' + - name: Sign the XCFrameworks env: - BUILD_CERTIFICATE_BASE64: ${{ secrets.GINI_DISTRIBUTION_CERTIFICATE }} - P12_PASSWORD: ${{ secrets.GINI_DISTRIBUTION_CERTIFICATE_SECRET }} - BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.GINI_BANK_SDK_EXAMPLE_ADHOC_DISTRIBUTION_PROVISION_PROFILE }} - BUILD_PROVISION_PROFILE_EXTENSION_BASE64: ${{ secrets.GINI_BANK_SDK_EXTENSION_ADHOC_DISTRIBUTION_PROVISION_PROFILE }} - KEYCHAIN_PASSWORD: ${{ secrets.GINI_DISTRIBUTION_CERTIFICATE_SECRET }} + KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} run: | - # Setup distribution certificate - CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 - PP_PATH1=$RUNNER_TEMP/build_pp1.mobileprovision - PP_PATH2=$RUNNER_TEMP/build_pp2.mobileprovision - - KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db - - # import certificate and provisioning profile from secrets - echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH - echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH1 - echo -n "$BUILD_PROVISION_PROFILE_EXTENSION_BASE64" | base64 --decode -o $PP_PATH2 - - # create temporary keychain - security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH - security set-keychain-settings -lut 21600 $KEYCHAIN_PATH - security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH - - # import certificate to keychain - security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH - security list-keychain -d user -s $KEYCHAIN_PATH - - # apply provisioning profile - mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles - cp $PP_PATH1 ~/Library/MobileDevice/Provisioning\ Profiles - cp $PP_PATH2 ~/Library/MobileDevice/Provisioning\ Profiles - # sign xcframeworks - codesign --timestamp -v --sign "Apple Distribution: Gini GmbH (JA825X8F7Z)" GiniBankAPILibrary.xcframework && \ - codesign --timestamp -v --sign "Apple Distribution: Gini GmbH (JA825X8F7Z)" GiniCaptureSDK.xcframework && \ - codesign --timestamp -v --sign "Apple Distribution: Gini GmbH (JA825X8F7Z)" GiniBankSDK.xcframework && \ - codesign --timestamp -v --sign "Apple Distribution: Gini GmbH (JA825X8F7Z)" GiniBankAPILibraryPinning.xcframework && \ - codesign --timestamp -v --sign "Apple Distribution: Gini GmbH (JA825X8F7Z)" GiniCaptureSDKPinning.xcframework && \ - codesign --timestamp -v --sign "Apple Distribution: Gini GmbH (JA825X8F7Z)" GiniBankSDKPinning.xcframework + codesign --timestamp -v --sign "iPhone Distribution: Gini GmbH (JA825X8F7Z)" GiniBankAPILibrary.xcframework && \ + codesign --timestamp -v --sign "iPhone Distribution: Gini GmbH (JA825X8F7Z)" GiniCaptureSDK.xcframework && \ + codesign --timestamp -v --sign "iPhone Distribution: Gini GmbH (JA825X8F7Z)" GiniBankSDK.xcframework && \ + codesign --timestamp -v --sign "iPhone Distribution: Gini GmbH (JA825X8F7Z)" GiniBankAPILibraryPinning.xcframework && \ + codesign --timestamp -v --sign "iPhone Distribution: Gini GmbH (JA825X8F7Z)" GiniCaptureSDKPinning.xcframework && \ + codesign --timestamp -v --sign "iPhone Distribution: Gini GmbH (JA825X8F7Z)" GiniBankSDKPinning.xcframework - name: archive frameworks GiniBankAPILibrary uses: actions/upload-artifact@v4 diff --git a/.github/workflows/bank-sdk.release.yml b/.github/workflows/bank-sdk.release.yml index 941dcac096..b4399b9f0f 100644 --- a/.github/workflows/bank-sdk.release.yml +++ b/.github/workflows/bank-sdk.release.yml @@ -74,8 +74,4 @@ jobs: needs: release uses: gini/gini-mobile-ios/.github/workflows/bank-sdk.build.xcframeworks.yml@main secrets: - BUILD_CERTIFICATE_BASE64: ${{ secrets.GINI_DISTRIBUTION_CERTIFICATE }} - P12_PASSWORD: ${{ secrets.GINI_DISTRIBUTION_CERTIFICATE_SECRET }} - BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.GINI_BANK_SDK_EXAMPLE_ADHOC_DISTRIBUTION_PROVISION_PROFILE }} - BUILD_PROVISION_PROFILE_EXTENSION_BASE64: ${{ secrets.GINI_BANK_SDK_EXTENSION_ADHOC_DISTRIBUTION_PROVISION_PROFILE }} - KEYCHAIN_PASSWORD: ${{ secrets.GINI_DISTRIBUTION_CERTIFICATE_SECRET }} \ No newline at end of file + KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} \ No newline at end of file From c174de9ea31c638f5a0e8c47e0197fbaee83514f Mon Sep 17 00:00:00 2001 From: Lester Batres Date: Thu, 2 Oct 2025 16:39:38 +0200 Subject: [PATCH 107/110] ci: Added `docs` for new lanes. PP-1810 --- fastlane/Fastfile_archiving | 15 ++++++++++++++- fastlane/Fastfile_signing | 25 +++++++++++++++++++++++-- 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/fastlane/Fastfile_archiving b/fastlane/Fastfile_archiving index 21ecff47bb..40bf6a5fb4 100644 --- a/fastlane/Fastfile_archiving +++ b/fastlane/Fastfile_archiving @@ -3,7 +3,20 @@ default_platform(:ios) platform :ios do - desc "Build app for ad-hoc distribution" + desc <<~DOC + Build the app for ad-hoc distribution. + + Parameters: + distribution_type - Set to "adhoc" for ad-hoc provisioning profile. + export_method - Set to "ad-hoc" for ad-hoc export. + configuration - Build configuration to use. Default: "Release". + + Behavior: + - Builds the app using the ad-hoc provisioning profile. + - Exports the IPA with ad-hoc distribution method. + - Uses the Release build configuration. + - Delegates to build_app_with_provisioning lane with ad-hoc parameters. + DOC lane :build_app_adhoc do build_app_with_provisioning(distribution_type: "adhoc", export_method: "ad-hoc", configuration: "Release") end diff --git a/fastlane/Fastfile_signing b/fastlane/Fastfile_signing index 4c8a977e03..6078ed0ba3 100644 --- a/fastlane/Fastfile_signing +++ b/fastlane/Fastfile_signing @@ -3,7 +3,18 @@ default_platform(:ios) platform :ios do desc <<~DOC - Download the provisioning profiles stored in the remote repository to be used in github actions + Download provisioning profiles from the remote repository for GitHub Actions. + + Parameters: + APP_IDENTIFIER - The bundle identifier of the app (from ENV). + DISTRIBUTION_TYPE - The type of provisioning profile (appstore, adhoc, development, enterprise) (from ENV). + GIT_URL - The git repository URL where provisioning profiles are stored (from ENV). + KEYCHAIN_PASSWORD - The password for the temporary keychain (from ENV). + + Behavior: + - Sets up and unlocks a temporary keychain for code signing. + - Downloads and installs provisioning profiles using match in readonly mode. + - Does not modify the profiles repository (readonly: true). DOC lane :download_profiles do setup_temp_keychain @@ -70,7 +81,17 @@ platform :ios do ) end - desc "Delete temp signing keychain" + desc <<~DOC + Delete the temporary signing keychain created for CI builds. + + Parameters: + name - The name of the keychain to delete. Default: "app-signing". + + Behavior: + - Removes the temporary keychain from the system. + - Should be called after build/signing operations are complete to clean up resources. + - This is a private lane, intended to be called by other lanes only. + DOC private_lane :delete_temp_keychain do delete_keychain(name: "app-signing") end From 392349b98110a1c5bf90da1bc634945678b281cc Mon Sep 17 00:00:00 2001 From: Lester Batres Date: Tue, 7 Oct 2025 15:42:56 +0200 Subject: [PATCH 108/110] ci: Update credentials to use CI specific ones. PP-1810 --- .github/workflows/bank-api-library.release.yml | 2 +- .github/workflows/bank-sdk.check.yml | 14 ++++++++------ .../bank-sdk.publish.example.app.firebase.yml | 4 ++-- .github/workflows/bank-sdk.release.yml | 2 +- .github/workflows/capture-sdk.release.yml | 2 +- .github/workflows/health-api-library.check.yml | 4 ++-- .github/workflows/health-api-library.release.yml | 2 +- .github/workflows/health-sdk.check.yml | 4 ++-- .../health-sdk.publish.example.apps.firebase.yml | 4 ++-- .github/workflows/health-sdk.release.yml | 2 +- .github/workflows/merchant-sdk.check.yml | 4 ++-- .../merchant-sdk.publish.example.apps.firebase.yml | 4 ++-- .github/workflows/merchant-sdk.release.yml | 2 +- 13 files changed, 26 insertions(+), 24 deletions(-) diff --git a/.github/workflows/bank-api-library.release.yml b/.github/workflows/bank-api-library.release.yml index 15f22e870b..012880fc08 100644 --- a/.github/workflows/bank-api-library.release.yml +++ b/.github/workflows/bank-api-library.release.yml @@ -12,7 +12,7 @@ jobs: check: uses: gini/gini-mobile-ios/.github/workflows/bank-api-library.check.yml@main secrets: - GINI_MOBILE_TEST_CLIENT_SECRET: ${{ secrets.GINI_MOBILE_TEST_CLIENT_SECRET }} + GINI_MOBILE_TEST_CLIENT_SECRET: ${{ secrets.GINI_MOBILE_CI_PASSWORD }} release: needs: check diff --git a/.github/workflows/bank-sdk.check.yml b/.github/workflows/bank-sdk.check.yml index 895dd4ab05..63b0cc8746 100644 --- a/.github/workflows/bank-sdk.check.yml +++ b/.github/workflows/bank-sdk.check.yml @@ -55,8 +55,8 @@ jobs: - name: Build and run tests for "${{ matrix.target }}" uses: maierj/fastlane-action@5a3b971aaa26776459bb26894d6c1a1a84a311a7 # v3.1.0 env: - TEST_CLIENT_SECRET: ${{ secrets.GINI_MOBILE_TEST_CLIENT_SECRET }} - TEST_CLIENT_ID: "gini-mobile-test" + TEST_CLIENT_SECRET: ${{ secrets.GINI_MOBILE_CI_PASSWORD }} + TEST_CLIENT_ID: ${{ secrets.GINI_MOBILE_CI_USERNAME }} with: lane: 'run_unit_tests' options: > @@ -69,7 +69,8 @@ jobs: # Run example app and run unit and integration tests for both GiniBankSDK and GiniBankSDKPinning - name: Build example app and run unit and integration tests env: - TEST_CLIENT_SECRET: ${{ secrets.GINI_MOBILE_TEST_CLIENT_SECRET }} + TEST_CLIENT_SECRET: ${{ secrets.GINI_MOBILE_CI_PASSWORD }} + TEST_CLIENT_ID: ${{ secrets.GINI_MOBILE_CI_USERNAME }} if: ${{ matrix.target == 'GiniBankSDK' }} run: > xcodebuild clean test @@ -79,12 +80,13 @@ jobs: CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=NO - CLIENT_ID="gini-mobile-test" + CLIENT_ID="$TEST_CLIENT_ID" CLIENT_SECRET="$TEST_CLIENT_SECRET" - name: Build pinning example app and run unit and integration tests env: - TEST_CLIENT_SECRET: ${{ secrets.GINI_MOBILE_TEST_CLIENT_SECRET }} + TEST_CLIENT_SECRET: ${{ secrets.GINI_MOBILE_CI_PASSWORD }} + TEST_CLIENT_ID: ${{ secrets.GINI_MOBILE_CI_USERNAME }} if: ${{ matrix.target == 'GiniBankSDKPinning' }} run: > xcodebuild clean test @@ -94,5 +96,5 @@ jobs: CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=NO - CLIENT_ID="gini-mobile-test" + CLIENT_ID="$TEST_CLIENT_ID" CLIENT_SECRET="$TEST_CLIENT_SECRET" diff --git a/.github/workflows/bank-sdk.publish.example.app.firebase.yml b/.github/workflows/bank-sdk.publish.example.app.firebase.yml index 487419160f..112f669e89 100644 --- a/.github/workflows/bank-sdk.publish.example.app.firebase.yml +++ b/.github/workflows/bank-sdk.publish.example.app.firebase.yml @@ -53,8 +53,8 @@ jobs: - name: Setup Credentials run: | - plutil -replace client_id -string "gini-mobile-test" BankSDK/GiniBankSDKExample/GiniBankSDKExample/Credentials.plist - plutil -replace client_password -string "${{ secrets.GINI_MOBILE_TEST_CLIENT_SECRET }}" BankSDK/GiniBankSDKExample/GiniBankSDKExample/Credentials.plist + plutil -replace client_id -string "${{ secrets.GINI_MOBILE_CI_USERNAME }}" BankSDK/GiniBankSDKExample/GiniBankSDKExample/Credentials.plist + plutil -replace client_password -string "${{ secrets.GINI_MOBILE_CI_PASSWORD }}" BankSDK/GiniBankSDKExample/GiniBankSDKExample/Credentials.plist - name: Setup Firebase API Key run: | diff --git a/.github/workflows/bank-sdk.release.yml b/.github/workflows/bank-sdk.release.yml index b4399b9f0f..62ab4b3e53 100644 --- a/.github/workflows/bank-sdk.release.yml +++ b/.github/workflows/bank-sdk.release.yml @@ -12,7 +12,7 @@ jobs: check: uses: gini/gini-mobile-ios/.github/workflows/bank-sdk.check.yml@main secrets: - GINI_MOBILE_TEST_CLIENT_SECRET: ${{ secrets.GINI_MOBILE_TEST_CLIENT_SECRET }} + GINI_MOBILE_TEST_CLIENT_SECRET: ${{ secrets.GINI_MOBILE_CI_PASSWORD }} release: needs: check diff --git a/.github/workflows/capture-sdk.release.yml b/.github/workflows/capture-sdk.release.yml index d260c73ca8..f814be7ac4 100644 --- a/.github/workflows/capture-sdk.release.yml +++ b/.github/workflows/capture-sdk.release.yml @@ -12,7 +12,7 @@ jobs: check: uses: gini/gini-mobile-ios/.github/workflows/capture-sdk.check.yml@main secrets: - GINI_MOBILE_TEST_CLIENT_SECRET: ${{ secrets.GINI_MOBILE_TEST_CLIENT_SECRET }} + GINI_MOBILE_TEST_CLIENT_SECRET: ${{ secrets.GINI_MOBILE_CI_PASSWORD }} release: needs: check diff --git a/.github/workflows/health-api-library.check.yml b/.github/workflows/health-api-library.check.yml index 18b5012bfe..b346e1ec68 100644 --- a/.github/workflows/health-api-library.check.yml +++ b/.github/workflows/health-api-library.check.yml @@ -47,8 +47,8 @@ jobs: - name: Build and run tests for "${{ matrix.target }}" uses: maierj/fastlane-action@5a3b971aaa26776459bb26894d6c1a1a84a311a7 # v3.1.0 env: - TEST_CLIENT_SECRET: ${{ secrets.GINI_MOBILE_TEST_CLIENT_SECRET }} - TEST_CLIENT_ID: "gini-mobile-test" + TEST_CLIENT_SECRET: ${{ secrets.GINI_MOBILE_CI_PASSWORD }} + TEST_CLIENT_ID: ${{ secrets.GINI_MOBILE_CI_USERNAME }} with: lane: 'run_unit_tests' options: > diff --git a/.github/workflows/health-api-library.release.yml b/.github/workflows/health-api-library.release.yml index 3613be5fa3..b3dfbedc08 100644 --- a/.github/workflows/health-api-library.release.yml +++ b/.github/workflows/health-api-library.release.yml @@ -11,7 +11,7 @@ jobs: check: uses: gini/gini-mobile-ios/.github/workflows/health-api-library.check.yml@main secrets: - GINI_MOBILE_TEST_CLIENT_SECRET: ${{ secrets.GINI_MOBILE_TEST_CLIENT_SECRET }} + GINI_MOBILE_TEST_CLIENT_SECRET: ${{ secrets.GINI_MOBILE_CI_PASSWORD }} release: needs: check diff --git a/.github/workflows/health-sdk.check.yml b/.github/workflows/health-sdk.check.yml index bd2f39e399..e3315852a1 100644 --- a/.github/workflows/health-sdk.check.yml +++ b/.github/workflows/health-sdk.check.yml @@ -49,8 +49,8 @@ jobs: - name: Build and run tests for "${{ matrix.target }}" uses: maierj/fastlane-action@5a3b971aaa26776459bb26894d6c1a1a84a311a7 # v3.1.0 env: - TEST_CLIENT_SECRET: ${{ secrets.GINI_MOBILE_TEST_CLIENT_SECRET }} - TEST_CLIENT_ID: "gini-mobile-test" + TEST_CLIENT_SECRET: ${{ secrets.GINI_MOBILE_CI_PASSWORD }} + TEST_CLIENT_ID: ${{ secrets.GINI_MOBILE_CI_USERNAME }} with: lane: 'run_unit_tests' options: > diff --git a/.github/workflows/health-sdk.publish.example.apps.firebase.yml b/.github/workflows/health-sdk.publish.example.apps.firebase.yml index 0558d1c851..cc2ec83554 100644 --- a/.github/workflows/health-sdk.publish.example.apps.firebase.yml +++ b/.github/workflows/health-sdk.publish.example.apps.firebase.yml @@ -50,8 +50,8 @@ jobs: - name: Setup Credentials run: | sed -i '' \ - -e 's/clientID = "client_id"/clientID = "gini-mobile-test"/' \ - -e 's/clientPassword = "client_password"/clientPassword = "${{ secrets.GINI_MOBILE_TEST_CLIENT_SECRET }}"/' \ + -e 's/clientID = "client_id"/clientID = "${{ secrets.GINI_MOBILE_CI_USERNAME }}"/' \ + -e 's/clientPassword = "client_password"/clientPassword = "${{ secrets.GINI_MOBILE_CI_PASSWORD }}"/' \ HealthSDK/GiniHealthSDKExample/GiniHealthSDKExample/CredentialsManager.swift - name: Setup Firebase API Key diff --git a/.github/workflows/health-sdk.release.yml b/.github/workflows/health-sdk.release.yml index 794bd574e5..33aa50d180 100644 --- a/.github/workflows/health-sdk.release.yml +++ b/.github/workflows/health-sdk.release.yml @@ -11,7 +11,7 @@ jobs: check: uses: gini/gini-mobile-ios/.github/workflows/health-sdk.check.yml@main secrets: - GINI_MOBILE_TEST_CLIENT_SECRET: ${{ secrets.GINI_MOBILE_TEST_CLIENT_SECRET }} + GINI_MOBILE_TEST_CLIENT_SECRET: ${{ secrets.GINI_MOBILE_CI_PASSWORD }} release: needs: check diff --git a/.github/workflows/merchant-sdk.check.yml b/.github/workflows/merchant-sdk.check.yml index 7d7d939142..6e7e0f24e2 100644 --- a/.github/workflows/merchant-sdk.check.yml +++ b/.github/workflows/merchant-sdk.check.yml @@ -46,8 +46,8 @@ jobs: - name: Build and run tests for "${{ matrix.target }}" uses: maierj/fastlane-action@5a3b971aaa26776459bb26894d6c1a1a84a311a7 # v3.1.0 env: - TEST_CLIENT_SECRET: ${{ secrets.GINI_MOBILE_TEST_CLIENT_SECRET }} - TEST_CLIENT_ID: "gini-mobile-test" + TEST_CLIENT_SECRET: ${{ secrets.GINI_MOBILE_CI_PASSWORD }} + TEST_CLIENT_ID: ${{ secrets.GINI_MOBILE_CI_USERNAME }} with: lane: 'run_unit_tests' options: > diff --git a/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml b/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml index c3684f58d4..0804d950d2 100644 --- a/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml +++ b/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml @@ -52,8 +52,8 @@ jobs: - name: Setup Credentials run: | sed -i '' \ - -e 's/clientID = "client_id"/clientID = "gini-mobile-test"/' \ - -e 's/clientPassword = "client_password"/clientPassword = "${{ secrets.GINI_MOBILE_TEST_CLIENT_SECRET }}"/' \ + -e 's/clientID = "client_id"/clientID = "${{ secrets.GINI_MOBILE_CI_USERNAME }}"/' \ + -e 's/clientPassword = "client_password"/clientPassword = "${{ secrets.GINI_MOBILE_CI_PASSWORD }}"/' \ MerchantSDK/GiniMerchantSDKExample/GiniMerchantSDKExample/Sources/CredentialsManager.swift - name: Archiving project diff --git a/.github/workflows/merchant-sdk.release.yml b/.github/workflows/merchant-sdk.release.yml index 93aa2ed37a..42557b6954 100644 --- a/.github/workflows/merchant-sdk.release.yml +++ b/.github/workflows/merchant-sdk.release.yml @@ -11,7 +11,7 @@ jobs: check: uses: gini/gini-mobile-ios/.github/workflows/merchant-sdk.check.yml@main secrets: - GINI_MOBILE_TEST_CLIENT_SECRET: ${{ secrets.GINI_MOBILE_TEST_CLIENT_SECRET }} + GINI_MOBILE_TEST_CLIENT_SECRET: ${{ secrets.GINI_MOBILE_CI_PASSWORD }} release: needs: check From 1f9df4108eee46d8b03ba8eb79fe91d336460748 Mon Sep 17 00:00:00 2001 From: Lester Batres Date: Tue, 7 Oct 2025 16:02:00 +0200 Subject: [PATCH 109/110] ci: Fix security hotspots reported by Sonar Cloud PP-1810 --- .../bank-sdk.publish.example.app.firebase.yml | 11 ++++++++--- .../health-sdk.publish.example.apps.firebase.yml | 7 +++++-- .../merchant-sdk.publish.example.apps.firebase.yml | 7 +++++-- fastlane/Fastfile_signing | 2 +- 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/.github/workflows/bank-sdk.publish.example.app.firebase.yml b/.github/workflows/bank-sdk.publish.example.app.firebase.yml index 112f669e89..0b878cb4cb 100644 --- a/.github/workflows/bank-sdk.publish.example.app.firebase.yml +++ b/.github/workflows/bank-sdk.publish.example.app.firebase.yml @@ -52,13 +52,18 @@ jobs: } - name: Setup Credentials + env: + TEST_CLIENT_SECRET: ${{ secrets.GINI_MOBILE_CI_PASSWORD }} + TEST_CLIENT_ID: ${{ secrets.GINI_MOBILE_CI_USERNAME }} run: | - plutil -replace client_id -string "${{ secrets.GINI_MOBILE_CI_USERNAME }}" BankSDK/GiniBankSDKExample/GiniBankSDKExample/Credentials.plist - plutil -replace client_password -string "${{ secrets.GINI_MOBILE_CI_PASSWORD }}" BankSDK/GiniBankSDKExample/GiniBankSDKExample/Credentials.plist + plutil -replace client_id -string "$TEST_CLIENT_ID" BankSDK/GiniBankSDKExample/GiniBankSDKExample/Credentials.plist + plutil -replace client_password -string "$TEST_CLIENT_SECRET" BankSDK/GiniBankSDKExample/GiniBankSDKExample/Credentials.plist - name: Setup Firebase API Key + env: + FIREBASE_API_KEY: ${{ secrets.FIREBASE_API_KEY }} run: | - plutil -replace API_KEY -string "${{ secrets.FIREBASE_API_KEY }}" BankSDK/GiniBankSDKExample/GoogleService-Info.plist + plutil -replace API_KEY -string "$FIREBASE_API_KEY" BankSDK/GiniBankSDKExample/GoogleService-Info.plist - name: Archiving project uses: maierj/fastlane-action@5a3b971aaa26776459bb26894d6c1a1a84a311a7 # v3.1.0 diff --git a/.github/workflows/health-sdk.publish.example.apps.firebase.yml b/.github/workflows/health-sdk.publish.example.apps.firebase.yml index cc2ec83554..a9deebadee 100644 --- a/.github/workflows/health-sdk.publish.example.apps.firebase.yml +++ b/.github/workflows/health-sdk.publish.example.apps.firebase.yml @@ -48,10 +48,13 @@ jobs: } - name: Setup Credentials + env: + TEST_CLIENT_SECRET: ${{ secrets.GINI_MOBILE_CI_PASSWORD }} + TEST_CLIENT_ID: ${{ secrets.GINI_MOBILE_CI_USERNAME }} run: | sed -i '' \ - -e 's/clientID = "client_id"/clientID = "${{ secrets.GINI_MOBILE_CI_USERNAME }}"/' \ - -e 's/clientPassword = "client_password"/clientPassword = "${{ secrets.GINI_MOBILE_CI_PASSWORD }}"/' \ + -e 's/clientID = "client_id"/clientID = "$TEST_CLIENT_ID"/' \ + -e 's/clientPassword = "client_password"/clientPassword = "$TEST_CLIENT_SECRET"/' \ HealthSDK/GiniHealthSDKExample/GiniHealthSDKExample/CredentialsManager.swift - name: Setup Firebase API Key diff --git a/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml b/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml index 0804d950d2..630fe39058 100644 --- a/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml +++ b/.github/workflows/merchant-sdk.publish.example.apps.firebase.yml @@ -50,10 +50,13 @@ jobs: } - name: Setup Credentials + env: + TEST_CLIENT_SECRET: ${{ secrets.GINI_MOBILE_CI_PASSWORD }} + TEST_CLIENT_ID: ${{ secrets.GINI_MOBILE_CI_USERNAME }} run: | sed -i '' \ - -e 's/clientID = "client_id"/clientID = "${{ secrets.GINI_MOBILE_CI_USERNAME }}"/' \ - -e 's/clientPassword = "client_password"/clientPassword = "${{ secrets.GINI_MOBILE_CI_PASSWORD }}"/' \ + -e 's/clientID = "client_id"/clientID = "$TEST_CLIENT_ID"/' \ + -e 's/clientPassword = "client_password"/clientPassword = "$TEST_CLIENT_SECRET"/' \ MerchantSDK/GiniMerchantSDKExample/GiniMerchantSDKExample/Sources/CredentialsManager.swift - name: Archiving project diff --git a/fastlane/Fastfile_signing b/fastlane/Fastfile_signing index 6078ed0ba3..8a05e809ba 100644 --- a/fastlane/Fastfile_signing +++ b/fastlane/Fastfile_signing @@ -25,7 +25,7 @@ platform :ios do type: ENV["DISTRIBUTION_TYPE"], git_url: ENV["GIT_URL"], keychain_name: "app-signing", - keychain_password:ENV['KEYCHAIN_PASSWORD'], + keychain_password: ENV['KEYCHAIN_PASSWORD'], readonly: true ) end From 9fec5442ee3df0218b570c484dad8a21fbd6f341 Mon Sep 17 00:00:00 2001 From: Valentina Iancu Date: Tue, 7 Oct 2025 19:31:28 +0200 Subject: [PATCH 110/110] fix(GiniBankSDK): Fix error for using the old approach for getting colors from the scheme --- .../Components/DigitalInvoiceSkontoTableViewCell.swift | 10 +++++----- .../Components/DigitalLineItemTableViewCell.swift | 10 +++++----- .../DigitalLineItemTableViewCellViewModel.swift | 6 +++--- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/ReturnAssistant/DigitalInvoice/Components/DigitalInvoiceSkontoTableViewCell.swift b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/ReturnAssistant/DigitalInvoice/Components/DigitalInvoiceSkontoTableViewCell.swift index d4a9ef9482..23e48f7310 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/ReturnAssistant/DigitalInvoice/Components/DigitalInvoiceSkontoTableViewCell.swift +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/ReturnAssistant/DigitalInvoice/Components/DigitalInvoiceSkontoTableViewCell.swift @@ -160,15 +160,15 @@ class DigitalInvoiceSkontoTableViewCell: UITableViewCell { if viewModel.isSkontoApplied { editButton.isEnabled = true editButton.setTitleColor(.GiniBank.accent1, for: .normal) - titleLabel.textColor = .giniColorScheme().text.secondary.uiColor() - edgeCaseLabel.textColor = .giniColorScheme().text.secondary.uiColor() + titleLabel.textColor = .giniBankColorScheme().text.secondary.uiColor() + edgeCaseLabel.textColor = .giniBankColorScheme().text.secondary.uiColor() valueLabel.isHidden = false toggleSwitch.isOn = true } else { - editButton.setTitleColor(.giniColorScheme().textField.disabledText.uiColor(), + editButton.setTitleColor(.giniBankColorScheme().textField.disabledText.uiColor(), for: .normal) - titleLabel.textColor = .giniColorScheme().textField.disabledText.uiColor() - edgeCaseLabel.textColor = .giniColorScheme().textField.disabledText.uiColor() + titleLabel.textColor = .giniBankColorScheme().textField.disabledText.uiColor() + edgeCaseLabel.textColor = .giniBankColorScheme().textField.disabledText.uiColor() editButton.isEnabled = false valueLabel.isHidden = true toggleSwitch.isOn = false diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/ReturnAssistant/DigitalInvoice/Components/DigitalLineItemTableViewCell.swift b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/ReturnAssistant/DigitalInvoice/Components/DigitalLineItemTableViewCell.swift index a6f0afe206..8935c7bd02 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/ReturnAssistant/DigitalInvoice/Components/DigitalLineItemTableViewCell.swift +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/ReturnAssistant/DigitalInvoice/Components/DigitalLineItemTableViewCell.swift @@ -57,7 +57,7 @@ class DigitalLineItemTableViewCell: UITableViewCell { } private func setup() { - let bgColor: UIColor = .giniColorScheme().container.background.uiColor() + let bgColor: UIColor = .giniBankColorScheme().container.background.uiColor() backgroundColor = .clear contentView.backgroundColor = bgColor backgroundContainerView.backgroundColor = bgColor @@ -74,7 +74,7 @@ class DigitalLineItemTableViewCell: UITableViewCell { editButton.setTitle(Strings.editButtonTitle, for: .normal) editButton.isExclusiveTouch = true - separatorView.backgroundColor = .giniColorScheme().textField.border.uiColor() + separatorView.backgroundColor = .giniBankColorScheme().textField.border.uiColor() applySelectedColors() @@ -133,9 +133,9 @@ class DigitalLineItemTableViewCell: UITableViewCell { } private func applySelectedColors() { - nameLabel.textColor = .giniColorScheme().text.primary.uiColor() - priceLabel.textColor = .giniColorScheme().text.primary.uiColor() - unitPriceLabel.textColor = .giniColorScheme().text.secondary.uiColor() + nameLabel.textColor = .giniBankColorScheme().text.primary.uiColor() + priceLabel.textColor = .giniBankColorScheme().text.primary.uiColor() + unitPriceLabel.textColor = .giniBankColorScheme().text.secondary.uiColor() editButton.setTitleColor(.GiniBank.accent1, for: .normal) } diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/ReturnAssistant/DigitalInvoice/Components/DigitalLineItemTableViewCellViewModel.swift b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/ReturnAssistant/DigitalInvoice/Components/DigitalLineItemTableViewCellViewModel.swift index 7b20549318..39ed8f347c 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/ReturnAssistant/DigitalInvoice/Components/DigitalLineItemTableViewCellViewModel.swift +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/ReturnAssistant/DigitalInvoice/Components/DigitalLineItemTableViewCellViewModel.swift @@ -42,14 +42,14 @@ struct DigitalLineItemTableViewCellViewModel { var modeSwitchTintColor: UIColor { switch lineItem.selectedState { case .selected: - return .giniColorScheme().toggle.trackOn.uiColor() + return .giniBankColorScheme().toggle.trackOn.uiColor() case .deselected: - return .giniColorScheme().toggle.trackOff.uiColor() + return .giniBankColorScheme().toggle.trackOff.uiColor() } } var textTintColorStateDeselected: UIColor { - .giniColorScheme().textField.disabledText.uiColor() + .giniBankColorScheme().textField.disabledText.uiColor() } } extension DigitalLineItemTableViewCellViewModel {