Testing and Troubleshooting
Testing deferred linking on Android has platform constraints, mainly around install referrer availability and app-link verification state.
Deferred flow constraints
- Deferred matching is intended for first-launch flow after install.
- Deterministic matching uses Play Install Referrer
click_idwhen available. - If install referrer is unavailable, SDK falls back to probabilistic matching.
- Repeated deferred attempts in same install/session return
NotFirstLaunch.
Recommended deferred test flow
- Uninstall app from device/emulator.
- Open a Detour link in browser.
- Install and launch app.
- Verify
LinkResult.Successwithtype = DEFERRED, or expected fallback (NoLink/Error). - Relaunch app and confirm deferred is not re-consumed (
NotFirstLaunchbehavior).
Testing app links and scheme links
For app-link/scheme integration (LinkProcessingMode.ALL), verify both cold and warm starts.
App Link via ADB
adb shell am start -a android.intent.action.VIEW \
-d "https://<your-link-domain>/products/42" \
<your.package.name>
Expected: LinkResult.Success with type = VERIFIED.
Custom scheme via ADB
adb shell am start -a android.intent.action.VIEW \
-d "myapp://products/42" \
<your.package.name>
Expected: LinkResult.Success with type = SCHEME (only when LinkProcessingMode.ALL).
Troubleshooting checklist
Detour SDK not initializedDetour.initialize(...)was not called beforeprocessLink()/getDeferredLink().
- Immediate
NoLink- no matching click found; verify link click happened before install.
- Always
NotFirstLaunch- first-launch flag already stored; reinstall app for deferred testing.
- App links open browser instead of app
- check Dashboard app-link domain config and manifest intent-filter alignment.
- Custom scheme not handled
- verify manifest
<data android:scheme="...">andLinkProcessingMode.ALL.
- verify manifest
- Analytics events not visible
- ensure valid
apiKey/appIdand callDetourAnalyticsonly after SDK initialization.
- ensure valid
Debugging
Use logcat while testing:
adb logcat | grep -i detour
Useful tags from SDK internals:
DetourDetourApiClientInstallReferrerHelperDetourAnalytics
For complete end-to-end sample flows, use Examples.