Storage.setItems
Feature description
Stores multiple string values at once in the mobile app’s local storage. The data is preserved even if the app is closed and reopened.
Toss app Android/iOS 5.270.0 It is available on versions above. Before calling Storage.setItems.isSupported()You can check support with. If you call it on an unsupported version, UNSUPPORTED_APP_VERSION an error occurs.
Type
Storage.setItems(items: Record<string, string>): Promise<void>;Params
type Items = Record<string, string>;An object made up of the keys and string values to be saved.
Response
voidErrors
Code
Description
UNSUPPORTED_APP_VERSION
If the version of the Toss app currently running does not support this feature, it occurs immediately when called. Storage.setItems.isSupported()Check in advance with and, if it occurs, error.messageshow it to the user.
Example code
import { Storage } from "@apps-in-toss/web-framework";
if (Storage.setItems.isSupported()) {
await Storage.setItems({
theme: "dark",
language: "ko",
});
}Was this helpful?