-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathAppDelegate.swift
More file actions
60 lines (52 loc) · 2.47 KB
/
AppDelegate.swift
File metadata and controls
60 lines (52 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import Adyen
import Flutter
import UIKit
#if canImport(adyen_checkout)
import adyen_checkout
#endif
#if canImport(AdyenActions)
import AdyenActions
#endif
#if canImport(AdyenDropIn)
import AdyenDropIn
#endif
@main
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)
setDropInStyle()
setCardComponentStyle()
setBlikComponentStyle()
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
override func application(_: UIApplication, open url: URL, options _: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
RedirectComponent.applicationDidOpen(from: url)
return true
}
private func setDropInStyle() {
var dropInStyle = DropInComponent.Style()
dropInStyle.formComponent.mainButtonItem.button.backgroundColor = UIColor(named: "PrimaryBackground") ?? .black
dropInStyle.formComponent.mainButtonItem.button.title.color = UIColor(named: "PrimaryTitle") ?? .white
dropInStyle.formComponent.textField.tintColor = UIColor(named: "PrimaryBackground") ?? .black
AdyenAppearance.dropInStyle = dropInStyle
}
private func setCardComponentStyle() {
var cardComponentStyle = Adyen.FormComponentStyle()
cardComponentStyle.mainButtonItem.button.backgroundColor = UIColor(named: "PrimaryBackground") ?? .black
cardComponentStyle.mainButtonItem.button.title.color = UIColor(named: "PrimaryTitle") ?? .white
cardComponentStyle.textField.tintColor = UIColor(named: "PrimaryBackground") ?? .black
cardComponentStyle.backgroundColor = UIColor(named: "AppBackground") ?? .white
AdyenAppearance.cardComponentStyle = cardComponentStyle
}
private func setBlikComponentStyle() {
var blikComponentStyle = Adyen.FormComponentStyle()
blikComponentStyle.mainButtonItem.button.backgroundColor = UIColor(named: "PrimaryBackground") ?? .black
blikComponentStyle.mainButtonItem.button.title.color = UIColor(named: "PrimaryTitle") ?? .white
blikComponentStyle.textField.tintColor = UIColor(named: "PrimaryBackground") ?? .black
blikComponentStyle.backgroundColor = UIColor(named: "AppBackground") ?? .white
AdyenAppearance.blikComponentStyle = blikComponentStyle
}
}