iOS App Storage cleared after app restart


#1

Hey there,

im using ionic2 and since i update to the newest version i got problems with the “storage” provider. As the title says above the storage seems to get cleared after i close the app and start it again.

This is how i try to get the data

this.storage.get('data')
  .then((data) => {
    console.log(data)
  },
  (err) => {
    console.log(err)
  });

I bind storage like this
import {Storage} from "@ionic/storage";
constructor(private storage:Storage)

Does anyone has the same problem? I tried it with localforage


#2

Could be related to this issue: https://github.com/driftyco/ionic-storage/issues/20


#3

yeah thanks.

platform.ready().then((readySource) => {
      console.log('Platform ready from', readySource);
      // Platform now ready, execute any required native code
    });

did it for me