When deep linking via NavHost, is your startDestination temporary ignored and the NavHost correctly shows the deep linked route immediately? My app’s start destination has initial start up functionality (routes to login if not authenticated) that I would like to avoid during deep linking.
s
Stylianos Gakis
07/18/2024, 4:03 PM
The start destination is indeed not shown at all, nor is it in the backstack at all in the deep link case actually.
You can't just have the "log out" logic in your start destination, that has to be done either in each destination through some wrapper, or globally outside of which destination you are in
Stylianos Gakis
07/18/2024, 4:06 PM
Note that you can not go around that. It works this way so that if you're deep linked from some other app, if the user goes back they end up back in the app they came from, instead of staying in your app.
And it's also why
navigateUp()
does things differently in those specific scenarios where there is nothing else in the backstack so it recreates a new one depending on where you navigated up from.
j
Jonathan
07/18/2024, 4:07 PM
That’s awesome about the start destination not being shown. Which is what I want I definitely don’t want to get around it.
👍 1
Jonathan
07/18/2024, 4:15 PM
Looks like I misunderstood this
video▾
. I thought Ian was suggesting that only your start destination should have logic to route to your Login route. Major oops.