Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to map one link to another? #263

Open
Ghedeon opened this issue Oct 29, 2019 · 1 comment
Open

How to map one link to another? #263

Ghedeon opened this issue Oct 29, 2019 · 1 comment

Comments

@Ghedeon
Copy link

Ghedeon commented Oct 29, 2019

Let say there are multiple external links that resolve to the same app link.
Ex:
www.foo.com/home -> app://home
www.foo.com/dashboard -> app://home

Yes, we can list them all in @DeepLink annotation but in case we have some Uri pattern matching logic in the activity, we'd need to parse all of them. It would be much easier to just rethrow the app link, so it becomes a single source of truth, without www.foo.com/home even hitting the activity. Is there elegant way to declare such mapping? So far I can only think of custom handling in DeepLinkActivity.

@Ghedeon
Copy link
Author

Ghedeon commented Oct 29, 2019

This seems to be working:

    @JvmStatic
    @DeepLink("www.foo.com/home")
    fun messagesIntent(context: Context, extras: Bundle): Intent {
        extras.putString(DeepLink.URI, "app://home")
        return homeIntent(context)
    }

Is that ok to override DeepLink.URI like this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant