I want to auto-login every time the app starts, I am using FirebaseAuth, so my userid is auto-fetched, but it goes to the registration page directly, I want to check if the user exists or not if it exists, move it to the home screen else to the registration page. I know what to do, but where to check this and so navigation?
CodePudding user response:
What you're looking for is what we usually call a Splashscreen.
That's the screen you usually see on huge app's startup, with a loader.
On this screen, you can do all the stuff that is required for your app to run correctly :
- Preload your images.
- Load some datas from an API
- Check the user's state
That's the good place to choose to redirect your user toward the most appropriate screen