I am stuck at a place for sometime now and cannot find any help on it.
Scenario:
I have a Xamarin Forms app. When the app starts, I check if the user is logged in or not. If the user is logged in, I open Main Screen. But if the user is not logged in, I open the login view as Modal page Navigation.PushModalAsync on top of main screen.
Once the user is logged in, I remove this page and show my original Main page.
Problem
When the user presses Back button on phone, I want the Application to Exit. How can I do that.
Note: I am using Navigation stack to push and pop pages. In this case, I guess, I have to pop all the pages. But I can't figure out how.