Skip to content
Dashboard

Installation

Detour provides a Flutter plugin (detour_flutter_plugin) that bridges native Detour SDK behavior on Android and iOS.

Before installation, make sure your app is created in the Detour Dashboard and you have:

  • appID from API configuration
  • publishable apiKey from API configuration
  • platform integration snippets from App configuration
  • Flutter: >=3.3.0
  • Dart: ^3.11.1
  • Android min SDK: 24
  • iOS: 13.0+

Add the package to your pubspec.yaml:

dependencies:
detour_flutter_plugin: ^1.1.1

Then run:

Terminal window
flutter pub get

detour_flutter_plugin wraps native Detour SDKs:

  • Android bridge depends on com.swmansion.detour:detour-sdk:1.0.1.
  • iOS bridge depends on Detour CocoaPod (~> 1.0.2), pulled automatically via the plugin podspec.

For Android dependency resolution, keep google() and mavenCentral() in your project repositories.

For iOS integration updates, run:

Terminal window
cd ios
pod install
cd ..

Use your credentials in DetourConfig:

const DetourConfig(
apiKey: '<REPLACE_WITH_YOUR_API_KEY>',
appID: '<REPLACE_WITH_APP_ID_FROM_PLATFORM>',
shouldUseClipboard: true,
linkProcessingMode: LinkProcessingMode.all,
)

The plugin handles bridge wiring, but your app still needs native deep-link setup:

  • Android:
    • App Links intent-filter from Dashboard
    • optional custom scheme intent-filter (if you use scheme links)
  • iOS:
    • Associated Domains (applinks:<domain>)
    • CFBundleURLTypes for custom scheme links
    • if you override AppDelegate/SceneDelegate deep-link callbacks, always forward to super

iOS delegate forwarding (required when overriding)

Section titled “iOS delegate forwarding (required when overriding)”

Flutter plugins (including Detour) receive lifecycle callbacks through Flutter delegate chain.
If you override iOS deep-link callbacks, return super result:

override func application(
_ app: UIApplication,
open url: URL,
options: [UIApplication.OpenURLOptionsKey: Any] = [:]
) -> Bool {
return super.application(app, open: url, options: options)
}
override func application(
_ application: UIApplication,
continue userActivity: NSUserActivity,
restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void
) -> Bool {
return super.application(
application,
continue: userActivity,
restorationHandler: restorationHandler
)
}

Reference implementation:

  1. Integrate startup/runtime flow in Usage.
  2. Start from the runnable app in Examples.