Core

A central point for Monterosa SDK configuration. Coordinates communication between Monterosa SDK components (kits).

Configure a Core once, then hand it to whichever kits you need. Each kit registers itself with the Core it is given and is reused on subsequent calls, so from(core) is cheap to repeat.

// Configure before using any kit, typically in Application.onCreate
Core.enableLogging(BuildConfig.DEBUG) // optional, must precede configure
Core.configure(context, host = "cdn.monterosa.cloud", projectId = "<project-uuid>")

// Kits hang off the configured Core
val launcher = Launcher.default
val interactKit = InteractKit.default

Pass a name to run more than one project at a time. Each named Core keeps its own options and its own set of kits, and is retrieved with core rather than default:

Core.configure(context, host, projectId, name = "second-project")
val interactKit = InteractKit.from(Core.core("second-project"))

// When that screen goes away, release the Core and close every kit it owns
Core.purgeCore("second-project")

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Unique Core identifier

Link copied to clipboard

Options set for the Core. Read only.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun getConfiguration(): Options

Returns the current Options for this Core instance.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun kit(identifier: String): MonterosaKit?

Obtain MonterosaKit registered in the Core

Link copied to clipboard
open suspend override fun requestRemoteOptions(): Options

Fetches and returns the resolved Options, performing a remote config fetch if needed.