Conditional rootPage

I don’t know how common this is in the wild, but localStorage is not guaranteed to be persistent. The OS can wipe it to recover storage space at any time. Ionic Storage might be a more reliable choice.

Hmm. you might be right…
I always thought its only an iOS 8 thing that it might get cleared…
Since Ionic Storage is Promise based my approach from above does not work either i guess…

In an other app i had a loadingPage i showed every time when the app started and there i decided after (a minimum timespan) where to go next depending on the data.
it worked quite well for my usecase back then…

besides that - why isn’t it common to show an Intro/Tutorial/Onboarding - Page on first app start :smiley:

What I meant is that if you store that state in localStorage, you might end up showing that intro again at random instances where localStorage got wiped out from under you.

Since your situation is a one-way street, Promises should be fine. For the related case of “is user authenticated?”, I think it works much better to handle this using rxjs, as described here.

I had to wait for platform.ready since I need to call some cordova plugin for boot logic. In your case, you set conditional rootPage in constructor, it looked well

Ah sry, my fault - i was misreading the “quoted area”.
@myfifth: then i would probably show a loading page by default and handle the async stuff there.
I also experienced some problems when the rootpage is not set in the constructor or ngOnInit lifecycle hook.

Did anyone find a solution for this? I continuously get a blank screen trying to set the rootPage conditionally like the code samples in this thread.

It worked for me, i am in ionic 3. Thanks

There is really no difference, since you are using the ‘fat arrow’ function…