InAppConfigParser

Decodes the native-config JSON into an InAppMessage, strictly to the typed contract.

Presence of displayType is the gate — without it this is not a native in-app and the parser returns null. Parsing is fail-closed: a missing/malformed required field, an unknown display type, a missing display block, an empty required items array, or any coercion attempt (showClose:"true", duration:"5") collapses the whole config to null, so callers can safely no-op (the parser never throws). Unknown keys are ignored at every level. The envelope fields (inAppId/maxDisplays/cooldown/expireDate/ttl) are a deliberate extension over the contract and keep their existing tolerant reading.

Functions

Link copied to clipboard
fun parse(rawJson: String?): InAppMessage?