I have implemented deep linking for my application. And I am handling my deep links by
navController.handleDeepLink(intent)
It's working fine in normal cases.
The issue is when I have deep links like this:
https://example.com/list
It should take me to a listing page
https://example.com/list?id=SOMEID&type=SOMETYPE
This should redirect the user to the details page of the item.
But this is not happening. It always takes me to the listing screen. How can I fix this?
This is how I defined the deeplink in the nav file:
<deepLink
android:id="@+id/deeplinkList"
android:autoVerify="true"
app:uri="https://example.com/list" />
and details like this:
<fragment>
<argument
android:name="id"
app:argType="string" />
<argument
android:name="type"
app:argType="string" />
<deepLink
android:id="@+id/deeplinkDetails"
android:autoVerify="true"
app:uri="https://example.com/list?id={id}&type={type}" />
</fragment>
If I remove the deeplinkList
, deeplinkDetails
will work fine. How can I fix this issue?