The Activity reads intent.data after being re-created which causes the initial deep link to be launched again, even after the user navigates away to another screen or if another deep link has been received in the meantime. To avoid this, return null as deep link when savedInstanceState is non-null after re-creation.
addOnNewIntentListener() is called during each recomposition but the listener is never unregistered which can cause a leak and multiple navigator calls. To avoid this and make the code cleaner, use the produceState() function to encapsulate all deeplink state logic and unregister the listener in awaitDispose {}.
Catch IllegalStateException thrown by Navigator.navigate(url) when the url doesn't match any route.
intent.data
after being re-created which causes the initial deep link to be launched again, even after the user navigates away to another screen or if another deep link has been received in the meantime. To avoid this, returnnull
as deep link whensavedInstanceState
is non-null after re-creation.addOnNewIntentListener()
is called during each recomposition but the listener is never unregistered which can cause a leak and multiple navigator calls. To avoid this and make the code cleaner, use theproduceState()
function to encapsulate alldeeplink
state logic and unregister the listener inawaitDispose {}
.IllegalStateException
thrown byNavigator.navigate(url)
when the url doesn't match any route.