Package-level declarations

Types

Link copied to clipboard
interface MMKV

Facade for all platforms; implemented by each specific target.

Link copied to clipboard
class MMKVException(val message: String) : RuntimeException

When an exception occurs inside MKMB (not MMKV itself), it will be thrown.

Link copied to clipboard

MMKV process mode enum

Link copied to clipboard

MMKV configuration options

Properties

Link copied to clipboard

Default C library loader

actual val <Error class: unknown class>.defaultLoader: <Error class: unknown class>

Functions

Link copied to clipboard
actual fun MMKV.Companion.defaultMMKV(mode: MMKVMode, cryptKey: String?): MMKV
expect fun MMKV.Companion.defaultMMKV(mode: MMKVMode = MMKVMode.SINGLE_PROCESS, cryptKey: String? = null): MMKV

Get the default MMKV instance

actual fun <Error class: unknown class>.defaultMMKV(mode: <Error class: unknown class>, cryptKey: String?): <Error class: unknown class>
actual fun MMKV.Companion.defaultMMKV(mode: MMKVMode, cryptKey: String?): MMKV
Link copied to clipboard
inline fun <T : Parcelable> MMKV.get(key: String): T?

Get a Parcelable value

fun <T : Parcelable> MMKV.get(key: String, clazz: KClass<T>): T?
Link copied to clipboard
fun <Error class: unknown class>.getNSCoding(key: String, clazz: ObjCClass): Any?
Link copied to clipboard

Import data from SharedPreferences

Link copied to clipboard
actual fun MMKV.Companion.initialize(path: String, options: MMKVOptions)
fun MMKV.Companion.initialize(path: String, conf: MMKVOptions.() -> Unit = {})
expect fun MMKV.Companion.initialize(path: String, options: MMKVOptions)

Initialize MMKV

actual fun <Error class: unknown class>.initialize(path: String, options: <Error class: unknown class>)
actual fun MMKV.Companion.initialize(path: String, options: MMKVOptions)
Link copied to clipboard
fun <Error class: unknown class>.initializeWithMultiProcess(group: String, options: <Error class: unknown class>)

Initialize MMKV with App Groups to enable data sharing across processes

Link copied to clipboard
actual fun MMKV.Companion.mmkvWithID(id: String, mode: MMKVMode, cryptKey: String?): MMKV
expect fun MMKV.Companion.mmkvWithID(id: String, mode: MMKVMode = MMKVMode.SINGLE_PROCESS, cryptKey: String? = null): MMKV

Get an MMKV instance by ID

actual fun <Error class: unknown class>.mmkvWithID(id: String, mode: <Error class: unknown class>, cryptKey: String?): <Error class: unknown class>
actual fun MMKV.Companion.mmkvWithID(id: String, mode: MMKVMode, cryptKey: String?): MMKV
Link copied to clipboard
fun <T : Parcelable> MMKV.set(key: String, value: T, expire: Int = 0)

Set a Parcelable value

fun <Error class: unknown class>.set(key: String, value: NSObject?, expire: Int = 0)