Hi, What is preferable: Using russhwolf library o...
# multiplatform
f
Hi, What is preferable: Using russhwolf library or datastore library (in alpha for kmm) for storing key value pairs??
c
Multiplatform Settings has support for DataStore, so the two are not mutually-exclusive. I personally like the API of Multiplatform Settings better than DataStore. And since it works as a wrapper around platform key-value stores, it’s more flexible and easier to integrate into a variety of scenarios for both new and old apps. DataStore has official support from Google, but I believe Multiplatform Settings was one of the very first MPP libraries, and though it’s primarily developed by one person, it has a solid track record of stability and support
plus1 1
f
Ah ok thanks for the insights. Appreciate it.
v
Does proto data store work in KMP tho?
How do you know? Have you tried it or they said that somewhere?
f
v
But that doesn't say that protobuf data store also works. Or it is meant by default?
e
Do either of them support encryption? I want to store a session token.
j
I'm releasing my Couchbase Lite KMP library soon, which supports key-value and SQL queries for JSON data. The enterprise edition supports encryption as well. My goal is to release this month.
v
@Emre No. Check KVault. It uses encrypted SP for android and something for iOS
e
r
yeah that article is a couple years old, but still largely accurate (modulo some name changes). Multiplatform Settings supports encryption directly via KeychainSettings on iOS, and indirectly on Android because you can freely pass EncryptedSharedPreferences to any SharedPreferences API. Nothing available on other platforms at the moment.
f
Is there a channel for Kotlin Multiplatform settings? Or are there any recent sample project I can look into?
r
No dedicated channel. People ask questions about it in #touchlab-tools sometimes, although technically it's my project and not Touchlab's.
e
@russhwolf When using
EncryptedSharedPreferences
, is the master key fixed for a given application? Otherwise you would not be able to read persisted data between runs.
f
@Emre in the article you shared i get an error on AndroidSettings and AppleSettings is there some dependency i didn’t add maybe?
r
@Emre Multiplatform Settings doesn’t care how you handle your master key. It just delegates to whatever
SharedPreferences
(or
EncrpytedSharedPreferences
) instance you pass to the
SharedPreferencesSettings
constructor.
@Farid Benhaimoud There were some renames since that article was written. See table in this changelog https://github.com/russhwolf/multiplatform-settings/blob/main/CHANGELOG.md#v100-alpha01-2022-06-02
466 Views