Deep links provide a way to link to specific content on either a website or an application. These links are indexable and searchable, and can provide users direct access to much more relevant information than a typical home page or screen. In the mobile context, the links are URIs that link to specific locations in the application. At Airbnb, we use these deep links frequently to link to listings, reservations, or search queries. Android supports deep links through declaration in the Manifest. You can add an intent filters which define a mapping between deep link schemas and Activities. Subsequently, any URI with the registered scheme, host, and path will open up that Activity in the app. You can’t easily indicate the parameters that you would expect in the URI that you are filtering for. For complex deep links, you are likely to have to write a parsing mechanism to extract out the parameters, or worse, have such similar code distributed amongst many Activities.
Features
- DeepLinkDispatch provides a declarative, annotation-based API to define application deep links
- You can register an Activity to handle specific deep links
- DeepLinkDispatch will parse the URI and dispatch the deep link to the appropriate Activity
- You can annotate a Kotlin object that is extending
- Query parameter conversion is supported for nullable and non nullable versions of Boolean
- Type conversion is handled via a lambda that you can set in the DeepLinkDelegate constructor