Lisandro Di Meo
06/24/2024, 12:56 PMLisandro Di Meo
06/24/2024, 12:57 PMcomposable<Route1>(
deepLinks = listOf( navDeepLink { uriPattern = "<example://compose/{id}>" } )
) {
val (id) = it.toRoute<Route1>()
Text(text = "Id is $id")
}
I've tried to launch this by running the command on adb shell am start -d "<example://compose/15>" -a android.intent.action.VIEW
, and the intent filter is the following:
<data android:scheme="example" />
<data android:host="compose" />
But throws a serialization error 🤔Stylianos Gakis
06/24/2024, 4:12 PMLisandro Di Meo
06/24/2024, 4:13 PMdata class Route1(val id: Int)
Lisandro Di Meo
06/24/2024, 4:13 PMStylianos Gakis
06/24/2024, 4:34 PMLisandro Di Meo
06/24/2024, 4:58 PMcomposable<Route1>(
deepLinks = listOf(
navDeepLink { uriPattern = "<example://compose/{id}>" }
)
) {
val routeInstance = it.arguments?.getInt("id")?.run { Route1(this) } ?: it.toRoute()
Text(text = "Route is $routeInstance")
}
Lisandro Di Meo
06/24/2024, 4:59 PMLisandro Di Meo
06/24/2024, 4:59 PMIan Lake
06/24/2024, 5:09 PMnavDeepLink<Route1>
API: https://androiddev.social/@ianlake/112599858226100367Lisandro Di Meo
06/24/2024, 6:02 PMcomposable<Route1>(
deepLinks = listOf(
navDeepLink<Route1>("<example://compose/{id}>"),
),
) {
val routeInstance = it.toRoute<Route1>()
Text(text = "Route is $routeInstance")
}
Stylianos Gakis
06/24/2024, 6:15 PM{id}
part in there looks wrong.Lisandro Di Meo
06/24/2024, 6:20 PM{id}
and it didn't work. I'll take a look on that anyways