Skip to main content

bn.setStorageSync

setStorageSync(key, data): void

description To store data in the local cache key In. Will overwrite the original key The corresponding content. Data is always available unless the user actively deletes it or the system cleans it for storage reasons. single key The maximum length of data allowed to be stored is 1 MB, all data storage capped at 10MB.

example

try {
bn.setStorageSync('key', 'value')
} catch (error) {
// From the something when catch error
}

Parameters

NameType
keystring
dataunknown

Returns

void