How to show only on first time opening app? (localstorage)

Hi all,

I have this bunch of code: http://codepen.io/mhartington/pen/YPLVay

Thanks to Mister Hartington. The thing is… you can see a slight one second delay when using localstorage. I don’t want that…

I want to show a tutorial ONLY the first time you open the app and after that, it shouldn’t be shown anymore. I tried using ng-cookies; that worked on the browser, but in the app, it’s not working at all.

So now, I am trying to implement localstorage, but it seems like this is not the best move either. It shows me a slight delay and I don’t want that to happen.

What is the best / most elegant way to do this? Could someone help me please?

2 Likes

No one who can help?

You should try this:

// Check if the user has already seen the tutorial
    this.storage.get('hasSeenTutorial')
      .then((hasSeenTutorial) => {
        if (hasSeenTutorial) {
          this.rootPage = TabsPage;
        } else {
          this.rootPage = TutorialPage;
        }
        this.platformReady()
      })

From: https://github.com/driftyco/ionic-conference-app/blob/master/src/app/app.component.ts

Hi, where to be exact? Could you provide a Codepen please? I don’t get where you get the storage from…

This is still not fixed.

Anyone?