Local Storage or Storage or NativeStorage?

window.localStorage is working fine for me but I see that there are multiple options like Storage and NativeStorage.What is the best storage to go for?All I need to store is around 20 strings as of now.

Use Ionic’s Storage service. It will automatically use the best storage available, which will be browser-based local storage by default, but if you install the SQLite plugin then it will use that instead (and the implementation remains the same, it can still be used as simple key-value storage).

3 Likes

Yeah, just going to repeat @joshmorony here

Ionic storage would be the best option.
It’s built on top of LocalForage, which will adapt the storage mechanism to what is available.
Be it Sqlite via cordova, IndexDB, or just regular localStorage

2 Likes

Thanks @joshmorony and @mhartington