Testing and Troubleshooting
Deferred flow testing has platform constraints: full attribution path depends on store redirect chain.
Deferred flow constraints
- Deferred matching is first-launch oriented.
- Runtime callbacks do not re-trigger deferred matching logic.
- Flutter bridge does not expose session reset API in
1.0.1.
Recommended deferred test flow
- Uninstall app from device/simulator.
- Open a Detour link.
- Install app and launch.
- Verify initial intent/result route in your UI logs.
- Relaunch app and confirm deferred behavior is not repeated.
Runtime link tests
Android App Link
adb shell am start -a android.intent.action.VIEW \
-d "https://<your-link-domain>/<link-token>" \
<your.package.name>
Android custom scheme
adb shell am start -a android.intent.action.VIEW \
-d "detour-flutter-example://products/42?source=scheme" \
<your.package.name>
iOS custom scheme (simulator)
xcrun simctl openurl booted "detour-flutter-example://products/42?source=scheme"
iOS universal link (simulator)
xcrun simctl openurl booted "https://<your-link-domain>/<link-token>"
Platform-specific notes
iOS
Clipboard matching requires that you copy the link to your clipboard before installing. Ensure shouldUseClipboard: true is set in DetourConfig and that the copy-link feature is enabled in the Detour dashboard for your iOS configuration.
Android
Install referrer click_id is often unavailable in local/dev-store scenarios. In that case matching falls back to probabilistic flow.
Testing Android App Links
Once your app is installed, clicking a Detour link in a messaging or notes app should open it directly. If it does not, your Android certificate may be misconfigured. Ensure you use the correct SHA-256 fingerprint in the Detour dashboard:
| How you install the app | SHA-256 to use |
|---|---|
| Directly from a built APK/AAB | Debug or release keystore on your machine |
| Google Play Internal Testing (installing via the Store) | Play Store App Signing Key |
Local development (flutter run) | Debug keystore (on your computer) |
Common issues
-
No match found (404)
- Check timestamps — the click may be older than the match window (15 minutes).
- Confirm the click was recorded in your Detour dashboard.
- On Android deterministic flow: confirm
click_idis present in the install referrer.
-
429 Too Many Requests
- Use staging API keys for heavy testing. Avoid sending many requests from many devices using the same key.
-
NOT_CONFIGUREDplatform error- Call
DetourService.start(...)orDetourFlutterPlugin.configure(...)beforeresolveInitialLink()/processLink().
- Call
-
iOS clipboard not read
- Ensure
shouldUseClipboard: trueis set inDetourConfig. - Ensure the copy-link feature is enabled in the Detour dashboard for your iOS app configuration.
- The link must be copied to the clipboard before the app is opened — the clipboard is only read during
resolveInitialLink().
- Ensure
-
UNSUPPORTED_EVENTerror onlogEvent- Flutter API accepts only predefined
DetourEventNamevalues.
- Flutter API accepts only predefined
-
Deferred link not returned on subsequent test runs
- Deferred matching is first-launch based; reinstall app for clean re-test.
Debugging
- Android:
adb logcat | grep -i detour
- iOS simulator:
xcrun simctl spawn booted log stream --predicate 'subsystem == "com.swmansion.detour"'
For full runnable setup and commands, use Examples.