Onboarding/tutorial check for new users

Hey all … in my PWA (Ionic/Angular with Capacitor) I’m having a simple 4 slide onboarding/tutorial feature that displays on first open for new users. Used Ionic generate to create a page (Welcome) and I’ve set that as the default in the Router so it always loads first. The last slide has a button that when clicked sets a value using Capacitor Storage and then moves the user to the Home route (/home).

So where is the best or correct place to check for that value? ngOnInit in app.component.ts or a Guard on the /welcome route or somewhere else? Should it be a Service even?

Hoping for some guidance :slight_smile:

Thanks.

That’s where I would do it, along with the other app initialization stuff.

Hey thanks for the reply @rapropos :slight_smile:

OK so let me get this clear … I check for the presence of and value of hasSeenTutorial using Capacitor and if found use something like this.router.navigate([’/home’]) for instance to skip the Welcome page and go straight to the Home page?

Cheers :slight_smile:

Yes, except I didn’t know “Capacitor Storage” was a thing. Maybe they’ve rebranded it, but I know it as Ionic Storage. With a PWA, you probably want the IndexedDB driver (which I believe is the default).

Ahh OK … https://capacitor.ionicframework.com/docs/apis/storage is what I’m looking at … I’m thinking it is different to Ionic Storage but should do the job the same :slight_smile:

Thanks for the reply. Learning heaps from your post responses :slight_smile:

Cheers