Raghunandan Kavi
Raghunandan Kavi

Reputation: 61

Deep link support in android

We are trying to support implicit deep links in our app. The app uses navigation architecture components with bottom navigation tabs. I want to understand, if its possible to dynamically re route to a particular screen of the android app by writing re routing logic in one place. As per my knowledge, currently its not possible to support deep link without unique uri path for all screens of the app. How do we tackle this problem, if we don't have unique uri path? We have various screens like - homepage, task panel, goal panel, performance review etc. We want to support links like following-

  1. https://app.abc.com - should open home page of app
  2. https://app.abc.com/?empId=employeeId&showTaskDetails=true&taskIds=uuidslist - should open taks panel or goal panel based on the query parameters I am able to solve the second problem, where we want to open a specific page based on query parameter but facing issues while using the deep link for first link. Rather than opening homepage screen on " https://app.abc.com", task panel screen is opening up.

Upvotes: 2

Views: 773

Answers (2)

Raghunandan Kavi
Raghunandan Kavi

Reputation: 61

The paths must be unique. Both the above links open task panel or goal panel by default query params are null.

The way to handle this is use unique paths or use common activity to handle deep links parse the uri and use explicit deep links to open different screens. This worked for me.

https://developer.android.com/guide/navigation/navigation-deep-link

Upvotes: 0

zhangxaochen
zhangxaochen

Reputation: 34007

You could try this library.

https://app.abc.com/?empId=employeeId&showTaskDetails=true&taskIds=uuidslist

about the deeplink you mentioned, suggest that add path to diff pages, such as: https://app.abc.com/path1?empId=employeeId&showTaskDetails=true&taskIds=uuidslist

Upvotes: 0

Related Questions