Home > Enterprise >  React Native Async Storage : where are information storage at?Phone or App?
React Native Async Storage : where are information storage at?Phone or App?

Time:02-11

I am using Async storage in RN. A teaching video said the async storage is global storage. What does it mean? It is mean my data can be found from my phone or only from the app?( when I delete the app from phone, can I still find that information on phone?)

Besides, what's the size limitation of Async storage? Can I use it to store image or document?

CodePudding user response:

AsyncStorage's documentation actually has the answer to your question

AsyncStorage is an unencrypted, asynchronous, persistent, key-value storage system that is global to the app.

So if you've deleted your app, the data will be gone.

As to the size limitation of AsyncStorage, it is currently set to 6MB.

You can store literally anything as long as it is in string format, so if let's say you wish to store an image, convert it to base64 string, and store it, and when you need to retrieve or show the image, AsyncStorage.getItem gives you back the base64 string, convert it back to an image before showing it

  • Related