defaultMMKV

fun MMKV.Companion.defaultMMKV(mode: MMKVMode = MMKVMode.SINGLE_PROCESS, cryptKey: String? = null): MMKV

Returns a singleton MMKV instance backed by an internal center with event dispatching capability.

  • If it's the first call, creates a DelegatedMMKV wrapping the real default instance and registers it.

  • Subsequent calls return the same wrapped instance for the key "MMKV.default".

Return

The default MMKV instance enhanced with change notifications.

Parameters

mode

The storage mode for MMKV. Defaults to MMKVMode.SINGLE_PROCESS.

cryptKey

Optional encryption key. Passing null means no encryption.