init
suspend fun init(networkId: String, context: Context, eventHandler: EventHandler?, timeoutAfterSeconds: UInt? = Constants.DEFAULT_AD_REQUEST_TIMEOUT.toUInt(), cacheSizeInMb: Long? = Constants.DEFAULT_CACHE_SIZE, cachePath: String? = context.cacheDir.path + Constants.DEFAULT_CACHE_PATH): Boolean
Initialization method for the AdService. This sets up the httpclient and loads the cookies. Sets the context for the URL handling and the cache path and size.
Parameters
networkId
The unique identifier of the ad network.
context
application context required for handling URLs that are triggered if users interact with ads
eventHandler
for observing and handling events
timeoutAfterSeconds
optional timeout for the cookie loading, in seconds.
cacheSizeInMb
optional cache size, in MB
cachePath
optional cache path