Hello I am struggling with creating a feature in my app. I wish to make an “Welcome” screen in my app that appears only the first time that the user has opened an app and then never again.
So what I’m struggling with is how to approach making this feature… my plan is to create a page component with a button to navigate to the login screen. But what I don’t know is how save that state that his screen has already been seen by the user and the app should not load it upon second time opening the app…
I am assuming that
1.) I need to make a service that will get and set data in the storage memory (Do I use the capacitor PREFERENCES for this or ionic storage?)
2.) I need to check if there is welcomeScreenShown variable set in the storage, and read it’s value. (How and where?)
3.) if it’s false, then display the welcome screen and then set the welcomeScreenShown to true, so next time the screen won’t be displayed and it will reroute the user to the homepage
Is this correct? Has anyone done such a thing and could someone provide some code for reference?
Well I tried using Ionic Storage but am getting a warning in CLI in console…
WARNING
/…/…/…/…/Angular/my-app/node_modules/@ionic/storage/dist/esm/index.js depends on ‘localforage’. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see:
So now I have an issue that my app keeps skipping the startup page and goes straight to login and when I try to log in it stays on this page… the console.log show that the state is set to done…
so here is how my code looks like now: app-routing.module.ts:
so what have I done wrong? I want the user to see this startup page then click a button to go to login and continiue using the app… and next time he opens the app the app doesent show the startup screen