Open antoine-dbr opened 7 years ago
@antoine-dbr thanks for the detailed issue explanation. one quick question to make sure I understand your problem. You're saying that you're sending a deep link to yourself, apparently from the shouldOverrideUrlLoading()
method above but any extras in the original intent are getting lost when going through DeepLinkDispatch. Is that correct?
I don't see any extras being added in the snippet above so I got confused. If that's it, then it should be a simple fix.
Thanks @felipecsl for the quick feedback, if I put a breakpoint in that shouldOverrideUrlLoading(view, url) method, the url param looks like this:
tm-snapshot://auth?state=XXXXXXXXXXX&code=XXXXXXXXXXX
Therefore, based on the doc, I would expect DeepLinkDispatch to deserialize the state and code query params and populate an intent with state and code extras that gets delivered to my onNewIntent method.
Makes sense?
That's correct. You can see that behavior being tested in a unit test here. Maybe there's something wrong about your URL. Can you provide a sample one?
tm-snapshot://auth?state=uber-2490d2b5-f776-4d6e-99d3-6ba9a55e1c95&code=wawQ5wwBDXDA3A4dfpJQq7c7LJ2pSq#_
Hey guys - first kudos on this library ! I am using it heavily in our Android app where we started deep-linking to a bunch of pages.
One minor issue I have is I am sending a deep-link to myself (for some OAuth flow) and the activity that needs to be linked is already around on the navigation backstack and configured as singleTask since I don't want to be created again on the nav stack when firing the deep-link.
The deep-link works as my activity onNewIntent() method get called as expected but the intent doesn't contain any extras and I am going to have to parse the intent data myself, which is too bad, since that's the big value-add of this lib.
Here are some snippets of what I am doing:
Custom annotation for starters:
I am intercepting the link from my webview and fire a deep-link to myself.
This is is activity that is configured as single task and initially pushed the webview-based activity so it's still around on the nav stack but not visible.
And this is the method that parse out that intent and would expect to have state and code as extras since they end up being serialized as query params in the deep-link url.
Also, I may doing something wrong and in that case, I apologize for the bother. Thanks!