Store public data in Local Storage
Store public data in Local Storage
Allows you to save key/value pairs of sensitive data and protects it via device's internal security.
- Uses NSUserDefaults for iOS, and
- SharedPreferences (ClearText) for Android
To get started using it, you must use KmpPublicStorage.
Persist data in storage
_1KmpPublicStorage.persistData("my_key", dataToStore) // dataToStore can be a String, Int, Boolean, or Float
Fetch data from Storage
Below are the functions available:
_4KmpPublicStorage.getStringFromKey(key: String): String_4KmpPublicStorage.getIntFromKey(key: String): Int_4KmpPublicStorage.getFloatFromKey(key: String): Float_4KmpPublicStorage.getBooleanFromKey(key: String): Boolean
Clear data from Storage
To delete a key/value pair from storage:
_1KmpPublicStorage .deleteDataForKey(key: String)
And to clear all data from the store
_1KmpPublicStorage .clearEntireStore(key: String)
Any Required Setup?
None