DeepLinkDispatch icon indicating copy to clipboard operation
DeepLinkDispatch copied to clipboard

Get the parsed intent from DeeplinkDelegate

Open notsatyarth opened this issue 7 years ago • 6 comments

Hi,

Is there a way to get the parsed intent from DeeplinkDelegate? I am interested in getting the intent for a deeplink and then performing different functions. The current deeplink delegate does not seem to be supporting that. I presume this is by design to keep the API simple. But is this a valid usecase?

I guess I could replicate the feature by pulling out the code from DeeplinkDelegate. But I wanted to if this situation was avoided due to some forethought.

notsatyarth avatar Apr 10 '18 08:04 notsatyarth

Would make espresso testing simpler.

ShikherVerma avatar Apr 13 '18 21:04 ShikherVerma

It should be an easy addition. Just abstract away the intent creation logic of public DeepLinkResult dispatchFrom(Activity activity, Intent sourceIntent) function in DeepLinkDelegate.

Maybe we could have a public Intent intentFrom(Activity activity, Intent sourceIntent). That returns an intent if uri was successfully parsed or null if some error occured.

The dispatchFrom would then just be a wrapper which launches the return value from intentFrom

Maybe an intentFrom(Activity activity, Uri uri) would look nicer.

ShikherVerma avatar Apr 13 '18 21:04 ShikherVerma

Yes. I currently have an implementation which implements the functionality of a DeeplinkDelegate that the library generates to cater to the requirements I have. If the library owners feel it appropriate I'd love to formalize the API a bit more and contribute for the same.

notsatyarth avatar Apr 16 '18 15:04 notsatyarth

I think this is a great idea. Also, this could be an alternative for android navigation, especially when you have multiple modules on your project. I have created a simple implementation for this, you can check it here: https://github.com/okasurya/DeepLinkDispatch/commit/f95d0d3c3667510b0ea57c2b97ad83a8e653700e

okasurya avatar Jul 12 '18 06:07 okasurya

This would be really useful

Gnzlt avatar Jan 16 '19 14:01 Gnzlt

Hello guys I been having this issue for the past year hopping it will get into the code, how is this going? how can I help/contribute to make this change happens?

ivorsmorenburg avatar Oct 29 '20 17:10 ivorsmorenburg