On-device storage with set and get

Hi there

I am not a pro and haven’t figured it out by myself. I tried the tutorial

But looks like it doesn’t work. Meanwhile I read about set and get item to storage.

Would someone provide me with a simple example like in the tutorial how to store a value offline?



How do you mean it doesn’t work? The storage’s name has been changed to On-device storage but the functionality should be the same.

However, if you are only looking to store one value I would recommend the flow functions Get/Set item from/to storage. A common example is to store an authorization token in storage. When a user logs in, then use Set item to storage with the Item key token and the actual token as data to store. Then, in app launch you can try to Get item from storage with the key token and use that to login automatically. That’s just one example which can be modified to any use case.

1 Like