Open herveweb opened 8 months ago
Currently deeplink require manually handle on all platform, for example, in Android you can handle like this:
override fun onCreate(savedInstanceState: Bundle?) {
//....
intent.data?.let {
navigator.navigate(it.toString())
}
addOnNewIntentListener {
it?.data?.let {
navigator.navigate(it.toString())
}
}
}
I believe it's kinda confusing when you see a deepLinks
field in the Scene
method. It makes us think that it's readily available for all platforms. But I guess this might be coming in the future.
Unfortunately, for now I had to implement it separately on each platform. Thanks for the reply.
Yes I agree, the keyword makes people confused, I'm still trying to implement deeplink handling automatically.
Currently deeplink require manually handle on all platform, for example, in Android you can handle like this:
override fun onCreate(savedInstanceState: Bundle?) { //.... intent.data?.let { navigator.navigate(it.toString()) } addOnNewIntentListener { it?.data?.let { navigator.navigate(it.toString()) } } }
Hello, An for ios how do you do that ?
Currently deeplink require manually handle on all platform, for example, in Android you can handle like this:
override fun onCreate(savedInstanceState: Bundle?) { //.... intent.data?.let { navigator.navigate(it.toString()) } addOnNewIntentListener { it?.data?.let { navigator.navigate(it.toString()) } } }
People copy-pasting this code, please be careful not to send the deep link event multiple times on activity re-creation. Thus:
intent.data
only once when savedInstanceState
is nulladdOnNewIntentListener()
from a Composable function, make sure you only call it once and not on each recomposition. I would recommend using DisposableEffect
to also unregister the listener when it leaves the composition.
I've tried to setup deelinking using the
deeplink
field in thescene
for my screen but it's not working for me.Any chance I can please get a link to some documentation on how to set it up?