Skip to content

Commit c4e4a77

Browse files
Inject urlSessionDelegate for handling session-level events
1 parent 47b566e commit c4e4a77

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

AdyenNetworking/APIClient/APIClient.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,18 @@ public final class APIClient: APIClientProtocol, AsyncAPIClientProtocol {
6666
/// - apiContext: The API context.
6767
/// - configuration: An optional `URLSessionConfiguration` to be used.
6868
/// If no value is provided - `URLSessionConfiguration.ephemereal` will be used.
69-
/// - coder: The coder used for encoding request's body and parsing response's body
69+
/// - coder: The coder used for encoding request's body and parsing response's body.
70+
/// - urlSessionDelegate: The delegate used for handling session-level events.
7071
public init(
7172
apiContext: AnyAPIContext,
7273
configuration: URLSessionConfiguration? = nil,
73-
coder: AnyCoder = Coder()
74+
coder: AnyCoder = Coder(),
75+
urlSessionDelegate: URLSessionDelegate? = nil
7476
) {
7577
self.apiContext = apiContext
7678
self.urlSession = URLSession(
7779
configuration: configuration ?? Self.buildDefaultConfiguration(),
78-
delegate: nil,
80+
delegate: urlSessionDelegate,
7981
delegateQueue: .main
8082
)
8183
self.coder = coder

0 commit comments

Comments
 (0)