Package org.cleaninsights.sdk

Types

Link copied to clipboard
data class Campaign(    val start: Calendar,     val end: Calendar,     val aggregationPeriodLength: Long,     val numberOfPeriods: Int = 1,     val onlyRecordOnce: Boolean = false,     val eventAggregationRule: EventAggregationRule = EventAggregationRule.Sum,     val strengthenAnonymity: Boolean = false)
Link copied to clipboard
class CampaignConsent(val campaignId: String, consent: Consent) : Consent
Link copied to clipboard
open class CleanInsights(val configuration: Configuration, store: Store)
Link copied to clipboard
data class Configuration(    val server: URL,     val siteId: Int,     val campaigns: Map<String, Campaign>,     val timeout: Double = 5.0,     val maxRetryDelay: Double = 3600.0,     val maxAgeOfOldData: Int = 100,     val persistEveryNTimes: Int = 10,     val serverSideAnonymousUsage: Boolean = false,     val debug: Boolean = false)
Link copied to clipboard
open class Consent(    val granted: Boolean,     val start: Calendar = CleanInsights.now(),     val end: Calendar = CleanInsights.now())
Link copied to clipboard
interface ConsentRequestUi
Link copied to clipboard
typealias ConsentRequestUiComplete = (granted: Boolean) -> Unit
Link copied to clipboard
interface ConsentRequestUiCompletionHandler

Used for Java interop.

Link copied to clipboard
class Consents

This class keeps track of all granted or denied consents of a user.

Link copied to clipboard
open class DataPoint(    val campaignId: String,     var times: Int = 1,     val first: Calendar = CleanInsights.now(),     val last: Calendar = CleanInsights.now())
Link copied to clipboard
interface DebugHandler
Link copied to clipboard
open class DefaultStore(args: Map<String, Any> = HashMap(), debug: (message: String) -> Unit = fun(_){}) : Store

Default implementation of a store. Stores the data in JSON format in a given folder.

Link copied to clipboard
interface DoneHandler
Link copied to clipboard
class Event(    val category: String,     val action: String,     val name: String?,     var value: Double?,     val campaignId: String,     var times: Int = 1,     val first: Calendar = CleanInsights.now(),     val last: Calendar = CleanInsights.now()) : DataPoint
Link copied to clipboard
enum EventAggregationRule : Enum<EventAggregationRule>
Link copied to clipboard
enum Feature : Enum<Feature>
Link copied to clipboard
class FeatureConsent(val feature: Feature, consent: Consent) : Consent
Link copied to clipboard
class Insights(    val idsite: Int,     val lang: String?,     val ua: String?)

Create an Insights object according to configuration with all data from the store which is due for offloading to the server.

Link copied to clipboard
interface JavaConsentRequestUi
Link copied to clipboard
abstract class JavaStore @JvmOverloads constructor(args: Map<String, Any> = HashMap(), debug: DebugHandler? = null) : Store

The store holds the user's consents to the different Features and Campaigns, and their Visit and Event measurements.

Link copied to clipboard
class Period(val start: Calendar, val end: Calendar)
Link copied to clipboard
abstract class Store(args: Map<String, Any> = HashMap(), debug: (message: String) -> Unit = fun(_){})

The store holds the user's consents to the different Features and Campaigns, and their Visit and Event measurements.

Link copied to clipboard
class Visit(    val scenePath: List<String>,     val campaignId: String,     var times: Int = 1,     val first: Calendar = CleanInsights.now(),     val last: Calendar = CleanInsights.now()) : DataPoint

Functions

Link copied to clipboard
fun CleanInsights.Companion.autoTrack(    context: Context,     server: URL,     siteId: Int,     campaigns: Map<String, Campaign>? = null): CleanInsights

Instantiates a singleton CleanInsights object with a default configuration and a default campaign named "visits" which never expires.

Properties

Link copied to clipboard
val CleanInsights.Companion.autoTrackCi: CleanInsights?