Installation
Detour provides an Android SDK (com.swmansion:detour) for deferred deep links, app links, and scheme links.
Before installation, make sure your app is created in the Detour Dashboard and you have:
appIdfrom API configuration- publishable
apiKeyfrom API configuration - Android link integration snippet from App configuration
Requirements
Section titled “Requirements”- Android min SDK:
21(Android 5.0+) - Kotlin:
2.0+ - JVM target:
11
Add dependency
Section titled “Add dependency”dependencies { implementation("com.swmansion:detour:1.0.1")}dependencies { implementation "com.swmansion:detour:1.0.1"}Configure credentials
Section titled “Configure credentials”Store credentials in config/environment and pass them through BuildConfig (same pattern as SDK examples):
buildConfigField("String", "DETOUR_API_KEY", "\"${secrets["DETOUR_API_KEY"] ?: ""}\"")buildConfigField("String", "DETOUR_APP_ID", "\"${secrets["DETOUR_APP_ID"] ?: ""}\"")// Activity/Application codeval config = DetourConfig( apiKey = BuildConfig.DETOUR_API_KEY, appId = BuildConfig.DETOUR_APP_ID)Initialize SDK once
Section titled “Initialize SDK once”Call Detour.initialize(...) once before processing links.
Detour.initialize(applicationContext, config)You can initialize in Application.onCreate() or in the first activity before calling processLink() / getDeferredLink().
Manifest integration
Section titled “Manifest integration”Add VIEW intent filters for links you want Android to dispatch to your app:
- verified App Links (
https://...) from Dashboard snippet - optional custom URI scheme (
myapp://...)
Example SDK apps use this pattern in AndroidManifest.xml and handle both app links and scheme links in one flow.