AdRequestConnection

class AdRequestConnection(val adRequest: AdRequest)

The AdRequestConnection represents a single connection to the ad server.

The ad request settings are encapsulated in a reusable object. The AdRequestConnection object encapsulates the states of a single communication, e.g. starting/canceling a connection.

adRequest A request that holds all the necessary data to build the ad request.

Constructors

Link copied to clipboard
constructor(adRequest: AdRequest)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
val maxAds: Int
Link copied to clipboard

The timeout for an ad request The request timeout is max(timeout, 3.seconds).

Functions

Link copied to clipboard
fun cancelAll()

Cancel all ongoing requests.

Link copied to clipboard
fun requestAds(responseHandler: (adManager: AdManager?, Error?) -> Unit)

Request ads from the ad server. This method can be used multiple times to get ads. Also it can be called again before the previous method call is finished.
responseHandler A handler to call back when the ad request completes or an error occurs (time out, etc).