Ionic 3 LocalStorage disappearing

1

I have an application on Ionic 1 that saves some information on the localStorage. I rewrote the same application on Ionic 3 with the same package id (widget id in config.xml), but when installing the new application over the old one I lose the localStorage, it comes empty.

If I install the old one again on top of the new one I can see the localStorage again, it's like they're different applications, but they have the same package id and I always install one over the other.

This happens only on mobile, applications are not sharing the same localStorage. When accessing google Devtools on the "Application" - "Storage" - "Local Storage" tab, "file: //" appears when I squeeze the application created in Ionic 1 and appears " when I run the application created in Ionic 3.

Is there any particularity in Ionic 3 that can not see / access the localStorage of Ionic 1 and vice versa?

    
asked by anonymous 20.12.2018 / 02:17

1 answer

1

LocalStorage is not a safe place to store data. Data can be periodically deleted by the operating system. The best solution is to use "Native Storage": link

    
20.12.2018 / 16:40