Skip to main content

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_id when available.
  • If install referrer is unavailable, SDK falls back to probabilistic matching.
  • Repeated deferred attempts in same install/session return NotFirstLaunch.
  1. Uninstall app from device/emulator.
  2. Open a Detour link in browser.
  3. Install and launch app.
  4. Verify LinkResult.Success with type = DEFERRED, or expected fallback (NoLink / Error).
  5. Relaunch app and confirm deferred is not re-consumed (NotFirstLaunch behavior).

For app-link/scheme integration (LinkProcessingMode.ALL), verify both cold and warm starts.

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 initialized
    • Detour.initialize(...) was not called before processLink() / 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="..."> and LinkProcessingMode.ALL.
  • Analytics events not visible
    • ensure valid apiKey/appId and call DetourAnalytics only after SDK initialization.

Debugging

Use logcat while testing:

adb logcat | grep -i detour

Useful tags from SDK internals:

  • Detour
  • DetourApiClient
  • InstallReferrerHelper
  • DetourAnalytics

For complete end-to-end sample flows, use Examples.