3

I searched over and over but could not find and answer to this:

  1. What happens to local storage (Used by high level storage class of Ionic 2/3 ) when updating the app?

I saw that when reinstalling it is removed.

Thank you.

Kerberos
  • 4,036
  • 3
  • 36
  • 55
tsahi
  • 31
  • 4

1 Answers1

2

I was wondering the same and found a link in which they claim that localStorage is not reliable, you should always use ionic native storage plugin.

Original post

It says that IOS clears localStorage when memory is low, and contains a link for android uses that reports inconsistencies too.

The safest bet is to always use ionic-storage

Edit

If you uninstall and reinstall the app, when you do that, it will clear all app data, including local DBs.

Sonicd300
  • 1,950
  • 1
  • 16
  • 22
  • Thank you for your answer, that is what I meant - using the class Storage (ionic-storage) , which is an higher implementation ( which uses "the best available options" as it states) . So using this class, the local data is saved on app updates??? – tsahi Nov 08 '17 at 19:04
  • my bad, i see what you're saying, well by reinstall, did you just updated it or uninstalled, if you do the latter data will be lost. – Sonicd300 Nov 08 '17 at 19:10
  • Update i did not tried- my client need some fixes and I want to make sure the local data of the users will not be lost – tsahi Nov 08 '17 at 19:14
  • So you say it wont be lost -both on android and IOS? no matter what? – tsahi Nov 08 '17 at 19:15
  • You can test it in a simulator, old app, some data, and upgrade it. Also check this post: https://stackoverflow.com/a/11282966/1303897 – Sonicd300 Nov 08 '17 at 19:16
  • Cool, please come back to this post with your results, upvote and accept if it worked. – Sonicd300 Nov 08 '17 at 19:24