Testing & Troubleshooting
Testing deferred links on iOS has platform constraints (App Store redirect chain, first-launch-only semantics).
Deferred flow constraints
Section titled “Deferred flow constraints”- Deferred matching is expected on first launch after install.
- SDK stores the first-entrance flag in
UserDefaults. Later launches return an empty result for the deferred fallback. - Session handling is single-pass. Repeated startup resolution in one session is skipped.
Recommended deferred test flow
Section titled “Recommended deferred test flow”- Uninstall the app from the device or simulator.
- Open a Detour link.
- Install and launch the app.
- Verify
result.link?.type == .deferredand expected route mapping. - Reopen app and confirm deferred link is not consumed again.
For local iteration without reinstall every time:
Detour.shared.resetSession(allowDeferredRetry: true)Testing runtime links
Section titled “Testing runtime links”Simulator custom scheme
Section titled “Simulator custom scheme”xcrun simctl openurl booted "myapp://products/42"Expected: runtime processLink resolves to .scheme.
Simulator universal link
Section titled “Simulator universal link”xcrun simctl openurl booted "https://<your-detour-domain>/products/42"Expected: runtime processLink resolves to .verified when associated domains are configured.
Troubleshooting checklist
Section titled “Troubleshooting checklist”- No link handled on cold start
- ensure
resolveInitialLink(config:launchOptions:)(orconnectionOptionsoverload) is called once at startup.
- ensure
- Universal links open Safari instead of app
- verify associated domains entitlement and Dashboard domain configuration.
- Scheme links do nothing
- verify
CFBundleURLTypesinInfo.plist.
- verify
- Expected scheme link is ignored
- check
linkProcessingMode..webOnlyand.deferredOnlyintentionally skip non-web URL-like links.
- check
- Analytics events missing in Dashboard
- ensure analytics is mounted (
resolveInitialLinkmounts it automatically, and a manual flow can callmountAnalytics).
- ensure analytics is mounted (
Debugging
Section titled “Debugging”SDK logs through Apple unified logging under subsystem com.swmansion.detour.
On simulator/device:
xcrun simctl spawn booted log stream --predicate 'subsystem == "com.swmansion.detour"'For end-to-end setup template, use Examples.