Network
-
Protocol for sending network requests and handling responses.
See moreDeclaration
Swift
public protocol NetworkClient -
The configuration that is used by the
NetworkClientto customize it’s behavior.You almost never need to change this as most of the Networking should happen via the shared
NetworkingClientinstance. If you need to add new interceptors you can do that directly on theNetworkClient.In case you really want to create a new client, start off from the
See moreNetworkConfiguration.defaultand edit it. Make sure to use aURLSessionConfigurationwithout cache and make sure to have at least the default interceptors.Declaration
Swift
public struct NetworkConfiguration -
A helper class that provides convenient methods for common network operations.
See moreDeclaration
Swift
public class NetworkHelper : NetworkHelperProtocol -
Protocol defining methods for common network operations.
See moreDeclaration
Swift
public protocol NetworkHelperProtocol -
A successful response returned by the NetworkClient
See moreDeclaration
Swift
public struct NetworkResponse -
NetworkResultFrom TealiumPrismCoreA successful Result with a NetworkResponse or a failed Result with NetworkError, returned by the NetworkClient
Declaration
Swift
public typealias NetworkResult = Result<NetworkResponse, NetworkError> -
A manager that handles system connectivity monitor and empirical connectivity monitor to establish when connectivity is actually available or not on the device.
The default behavior would be to always assume that connectivity is available until system monitor or empirical connectivity result unavailable or unknown.
See moreDeclaration
Swift
public class ConnectivityManager : ConnectivityManagerProtocol -
Protocol for managing network connectivity state and monitoring.
See moreDeclaration
Swift
public protocol ConnectivityManagerProtocol : RequestInterceptor -
An HTTP client that sends
URLRequests via aURLSession.URLRequests are sent as is and are retried according to theRequestInterceptors logic when necessary.RequestInterceptors are also notified of other events concerning the request lifecycle. Some of these events are related to theHTTPClientlogic and some are justURLSessionDelegateevents being forwarded.You should almost never create a new instance of this class but rather use the
See moresharedinstance, as it’s configured with sensible defaults and using oneURLSessioncomes with a series of optimizations. If you need to create a new instance make sure to start from adefaultconfiguration and only add new interceptors to the default ones.Declaration
Swift
public class HTTPClient : NetworkClient -
An interceptor that retries all retriable errors
See moreDeclaration
Swift
public class DefaultInterceptor : RequestInterceptor -
A class that handles some messages from the URLSession. It forwards them to the interceptors along with some other internal network client messages.
See moreDeclaration
Swift
public class InterceptorManager : NSObject, InterceptorManagerProtocol -
Protocol for managing request interceptors and handling network results.
See moreDeclaration
Swift
public protocol InterceptorManagerProtocol : URLSessionTaskDelegate -
Protocol for intercepting and handling network requests and responses.
See moreDeclaration
Swift
public protocol RequestInterceptor : AnyObject -
Parameters for configuring a resource refresher.
See moreDeclaration
Swift
public struct RefreshParameters -
An object that refreshes a single resource at regular intervals.
Refresh is requested by the user of ths class, but it’s ignored unless the required intervals have passed. The resource is cached locally and it’s re-read only on initialization or when subscribing
onResourceLoaded.You can listen to resource updates by using the
See moreonResourceLoadedobservable. This will first push an event with a resource read from disk, if present, and then all refreshes from remote.Declaration
Swift
public class ResourceRefresher<Resource> where Resource : Decodable, Resource : Encodable -
The policy, returned by a
See moreRequestInterceptorthat theNetworkClientshould apply on a givenNetworkResponse.Declaration
Swift
public enum RetryPolicy -
Declaration
-
Declaration
-
A protocol used to receive requests with String/URL/URLComponents intercheangebly
See moreDeclaration
Swift
public protocol URLConvertible -
ErrorCooldownFrom TealiumPrismCoreAn object that increases a cooldown for every error event, and resets the cooldown to 0 when a non-error event happens.
Declaration
Swift
public class ErrorCooldown -
A response containing a decoded object and the HTTP response.
See moreDeclaration
Swift
public struct ObjectResponse<T> -
ObjectResultFrom TealiumPrismCoreA result type for object responses.
Declaration
Swift
public typealias ObjectResult<T> = Result<ObjectResponse<T>, NetworkError>
View on GitHub
Network Reference