init
fun init(context: Context, apiUrl: String, apiHeaders: HashMap<String, String> = HashMap(), eventThreshold: List<EventThreshold> = listOf(EventThreshold.NumBased()), apiKey: String, cacheScheme: ICacheScheme = FileCacheManager(
context = context.applicationContext,
filePath = generateFilePath(apiKey)
), eventValidationConfig: EventValidationConfig = EventValidationConfig(), enableLogs: Boolean = BuildConfig.DEBUG, logger: Logger = EventKtLog(enableLogs)): EventKtTracker
Init - To make network call at library whenever a batch of events is ready
Return
Instance of EventKtTracker
Parameters
context
Application context
apiUrl
API url for making network request to server
apiHeaders
Headers included in API request
eventThreshold
List of EventThreshold based on which events get batched
apiKey
API key that is included in headers and also help generate unique file path for event storage
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