NetworkingFactory
public final class NetworkingFactory : NetworkingFactoryProtocol
Factory class for building an instance of EPINetworkingClient.
-
Initializes a
NetworkingFactory
with the specified parameters.Declaration
Swift
public init( logLevel: EPINetworkingLogLevel, accessTokenProvider: AccessTokenProviding, authenticationUpdate: @escaping (NetworkError) -> Void )
Parameters
logLevel
The log level for created
EPINetworkingClient
instances.accessTokenProvider
The access token provider for setting authorization headers.
authenticationUpdate
A closure to be called when authentication updates occur.
-
Builds and returns an instance of
EPINetworkingClient
.Declaration
Swift
public func build( baseUrl: String, appendAPI: Bool ) -> EPINetworkingClientProtocol
Parameters
baseUrl
The base URL for the networking client.
appendAPI
A flag indicating whether to append API path prefix (i.e. “/api”) to the base URL.
Return Value
An instance of
EPINetworkingClient
.