DecisionSDK

public class DecisionSDK

Represents the interface for making requests against the Adzerk Decision API

  • Provides storage for the default network ID to be used with all placement requests. If a value is present here, each placement request does not need to provide it. Any value in the placement request will override this value. Useful for the common case where the network ID is constant for your application.

    Declaration

    Swift

    public static var defaultNetworkId: Int?
  • Provides storage for the default site ID to be used with all placement requests. If a value is present here, each placement request does not need to provide it. Any value in the placement request will override this value. Useful for the common case where the network ID is constant for your application.

    Declaration

    Swift

    public static var defaultSiteId: Int?
  • The host to use for outgoing API requests. If not set, a default Adzerk hostname will be used that is based on the default network ID. This must be set prior to making requests.

    Failing to set defaultNetworkID or host explicitly will result in a fatalError.

    Note that the defaultNetworkID-based subdomain will not change if a different networkID is supplied for a specific request.

    Declaration

    Swift

    public static var host: String { get set }
  • Initializes a new instance of AdzerkSDK Parameters:

    • keyStore: The object that will store user keys. Defaults to a Keychain-based store.
    • queue: The queue that all callbacks will be dispatched on. Defaults to DispatchQueue.main.

    Declaration

    Swift

    public init(keyStore: UserKeyStore = UserKeyStoreKeychain(),
                transport: Transport? = nil,
                queue: DispatchQueue = .main, requestTimeout: TimeInterval = 30)
  • Undocumented

    Declaration

    Swift

    public func request<P>(placement: P, options: PlacementRequest<P>.Options? = nil, completion: @escaping (Result<PlacementResponse, AdzerkError>) -> Void) where P : Placement
  • Undocumented

    Declaration

    Swift

    public func request<P>(placements: [P], options: PlacementRequest<P>.Options? = nil, completion: @escaping (Result<PlacementResponse, AdzerkError>) -> Void) where P : Placement
  • Records an impression from a decision impression URL. This is a fire and forget request

    Declaration

    Swift

    public func recordImpression(pixelURL: URL)
  • Undocumented

    Declaration

    Swift

    public func userDB(networkId: Int? = nil) -> UserDB