initWithCallback

fun initWithCallback(context: Context, eventThreshold: List<EventThreshold> = listOf(EventThreshold.NumBased()), directoryName: String, cacheScheme: ICacheScheme = FileCacheManager( context = context.applicationContext, filePath = directoryName ), eventValidationConfig: EventValidationConfig = EventValidationConfig(), enableLogs: Boolean = BuildConfig.DEBUG, logger: Logger = EventKtLog(enableLogs), makeNetworkRequest: suspend (String, List<EventNameParam>) -> Boolean): EventKtTracker

Init with callback - To send the list of EventNameParam and request body to client whenever a batch of events is ready

Return

Instance of EventKtTracker

Parameters

context

Application context

eventThreshold

List of EventThreshold based on which events get batched

directoryName

Unique directory name to store events in file system

cacheScheme

Caching logic for storing events on disk, Default - FileCacheManager

eventValidationConfig

Configure event limits, Default - EventValidationConfig

enableLogs

Boolean to enable logs, Default - BuildConfig.DEBUG

logger

Logger interface, client can implements its own Logger, Default - EventKtLog

makeNetworkRequest

Lambda (suspend function) that invokes whenever the batch of events is ready for network call, client passes boolean for successful or failure network call