Package-level declarations

Types

Link copied to clipboard
data class BrowserSummary(val browser: String, val version: String?, val os: String)

What a browser user agent says, reduced to what fits app.os_version and app.device_model.

Link copied to clipboard
data class HatangAppInfo(val appVersion: String? = null, val buildNumber: String? = null, val os: String = "android", val osVersion: String? = null, val deviceModel: String? = null, val deviceLocale: String? = null)

What the SDK tells the gateway about the host app and device. The Android module fills it from the package manager and Build; hosts may pass their own.

Link copied to clipboard
fun interface HatangClock

Where the SDK reads the current time; tests pass a fake one. Timers use the coroutine dispatcher.

Link copied to clipboard
class HatangLogger(val minLevel: HatangLogLevel = HatangLogLevel.INFO, val sink: (level: HatangLogLevel, message: String) -> Unit)

Where the SDK writes its logs: every record at or above minLevel goes to sink. The default is SILENT.

Link copied to clipboard

Log severity.

Properties

Link copied to clipboard
const val SDK_NAME: String

SDK name reported to the gateway (app.sdk, client.sdk, the user agent).

Link copied to clipboard
const val SDK_VERSION: String

SDK version reported to the gateway.

Functions

Link copied to clipboard

Reads the browser, its major version and the OS from a user agent string: Mozilla/5.0 (Macintosh; …) … Chrome/140.0.0.0 Safari/537.36 gives Chrome, 140, macOS.

Link copied to clipboard
fun clampLength(value: String?, max: Int): String?

value cut to max characters (null stays null).

Link copied to clipboard

A BCP 47 tag the gateway accepts (≤ 10 chars): extensions and scripts beyond language-region are dropped (en-US-u-ca-gregory → en-US).