setItem

suspend fun DeviceStorage.setItem(key: String, value: String): Boolean

Stores a key-value pair. This function suspends until the result is available and returns the result directly or throws an exception if an error occurred.

Return

Boolean indicating whether the operation was successful.

Parameters

key

The key to store the value under.

value

The value to store.

Throws

If an error occurs during the operation.


suspend fun SecureStorage.setItem(key: String, value: String): Boolean

Stores a key-value pair in secure storage. This suspending function handles the result directly and throws an exception if an error occurs.

Return

True if the operation was successful.

Parameters

key

The key to store the value under.

value

The value to store.

Throws

If an error occurs during the operation.