Navigation component seems just working with short dynamic link
Example: Long Dynamic Link
https://domaindebug.page.link/?link=https://www.website.com&apn=com.x.debug&isi=122...6&ibi=com.ios.x.debug&efr=1
Short Dynamic Link
https://domaindebug.page.link/register
<fragment
android:id="@+id/fragment_register"
android:name="com.x.presentation.feature.identification.view.RegisterFragment"
tools:layout="@layout/fragment_register">
<action
... />
<argument
android:name="code"
android:defaultValue="@null"
app:argType="string"
app:nullable="true" />
<deepLink
android:id="@+id/deepLink"
app:uri="https://domaindebug.page.link/register?code={code}" />
</fragment>
If I click on long dynamic link, nothing happens. How can I manage this? I also can't find any documentation about integrate firebase dynamic deeplink + navigation component
I have not seen any official integration of dynamic links with the navigation component so far. But it's pretty simple to integrate them manually by fetching the link with help of FirebaseDynamicLinks
and passing it to the NavController
:
FirebaseDynamicLinks.getInstance()
.getDynamicLink(intent)
.addOnSuccessListener(this) { link ->
findNavController(R.id.nav_host_fragment).handleDeepLink(Intent().apply {
data = link?.link
})
}
Please check out the sample project I've created to show the idea. It handles deep links in a separate activity to make UI smoother, but hands over the link to the navigation component for handling.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With