DeepLinkDispatch icon indicating copy to clipboard operation
DeepLinkDispatch copied to clipboard

Handle Uris with no host and params (e.g 'airbnb://')

Open romainpiel opened this issue 10 years ago • 11 comments

Not sure if it's a bug or on purpose but DeepLinkDispatch does not handle Uris with just the base scheme, like airbnb://. In that case, DeepLinkUri.parse() with return ParseResult.INVALID_HOST. Not sure if we should handle it, any other thoughts?

romainpiel avatar Dec 01 '15 14:12 romainpiel

Our initial thought was that we'd only accept valid URIs for deep links. If you need a catch-all you can still use the BroadcastReceiver. If you can present a legit reason to allow partial URIs maybe we can consider, otherwise I'd prefer not.

felipecsl avatar Dec 01 '15 17:12 felipecsl

I kinda see a use case for this after debating about it with @ysdong. The problem is that we'd have to skip the DeepLinkURI.parse() call in this case. I'll think about it for a bit

felipecsl avatar Dec 01 '15 19:12 felipecsl

I don't think there is a nice way to accept this pattern without modifying DeepLinkUri. Other alternatives would be to skip the parse() for that specific case but I don't believe that it's should be the DeepLinkEntry's responsibility to support that.

romainpiel avatar Dec 14 '15 11:12 romainpiel

We use deep links for a custom scheme without a host, just a scheme and a filepath.

E.g.

custom-scheme://basket custom-scheme://hotel/1234 custom-scheme://item?itemId=65

In this situation, the links are never used outside of deep linking into the app and so host is unnecessary, so we decided to exclude it.

lordcodes avatar Feb 26 '16 15:02 lordcodes

@andrewlord1990 Sorry to bring an old issue up, but I'm kinda confused here. I've understood that is not possible to have partial schemes, but you said you excluded 'it' and I guess it solved your problem. How did you solve that ? And is this ever going to be supported out-of-the-box ?

Thanks and nice job here guys !

leonardo2204 avatar Dec 05 '16 16:12 leonardo2204

you can't have a URI path and not a host. You're just misinterpreting it. In the examples @andrewlord1990 gave, basket, hotel and item would be the host, respectively.

felipecsl avatar Dec 05 '16 19:12 felipecsl

@felipecsl Thanks for the feedback, I think I got the idea, but in my app we use just like @andrewlord1990 said. Is there any milestone for that ?

Thanks

leonardo2204 avatar Dec 05 '16 19:12 leonardo2204

@leonardo2204 those URLs should work fine with DeepLinkDispatch. Have you tried it and it didnt' work?

felipecsl avatar Dec 05 '16 20:12 felipecsl

Hey @felipecsl, just to clarify, using like: bla:///campaigns/{bla} or bla:///test/another will it work ?

Thanks again

leonardo2204 avatar Dec 06 '16 13:12 leonardo2204

@leonardo2204 yep, that works fine

felipecsl avatar Dec 06 '16 18:12 felipecsl

Any workarounds how to handle this in DeepLinkDispatch in case the old app was already supporting app:// and it's not possible to change it at the moment?

Ghedeon avatar Oct 28 '19 16:10 Ghedeon