Returns the secret stored in item, creating and saving a random one when nothing is stored.
Use it with a SecureStore-backed item to keep, for example, the encryption key of an MMKV
instance.
A new secret is written only when the key is empty. Anything else stored there is never
overwritten: unreadable or invalid data rejects with its read error (CORRUPT_DATA,
VALIDATION_FAILED, INCOMPATIBLE_VERSION, DRIVER_ERROR), a stored value that is not a
non-empty string with CORRUPT_DATA, and an expired one with EXPIRED. Calls made while
another call for the same driver and key is running share its result, so two parts of the app
starting at once never end up with different keys.
Returns the secret stored in
item, creating and saving a random one when nothing is stored. Use it with a SecureStore-backed item to keep, for example, the encryption key of an MMKV instance.A new secret is written only when the key is empty. Anything else stored there is never overwritten: unreadable or invalid data rejects with its read error (
CORRUPT_DATA,VALIDATION_FAILED,INCOMPATIBLE_VERSION,DRIVER_ERROR), a stored value that is not a non-empty string withCORRUPT_DATA, and an expired one withEXPIRED. Calls made while another call for the same driver and key is running share its result, so two parts of the app starting at once never end up with different keys.