kmm-preferences
1.1.0indexedAccess shared preferences on iOS and Android, enabling storage and retrieval of key-value pairs with serialization support for complex data types.
1
Stars
—
Used by
dependents
—
Health
/ 100
Access shared preferences on iOS and Android, enabling storage and retrieval of key-value pairs with serialization support for complex data types.

This is a Kotlin MultiPlatform library that provides access to the shared preferences on iOS & Android.
kotlin {
sourceSets {
val commonMain by getting {
dependencies {
implementation("de.gal-digital:kmm-preferences:x.x.x")
}
}
}
}
class Settings(sharedPreferences : SharedPreferences) {
private val jsonSerializer = Json {}
var token : String? by preference(sharedPreferences, "token", null)
var user : SomeSerializable? by serializable(sharedPreferences,jsonSerializer,"user", null)
}
Surfaced from shared tags and platforms — no rankings paid for.