Index of every page on this site: llms.txt
All skills
software-mansion-labs avatar

/detour-onboarding

@43cde80
Run it yourself

Complete onboarding guide for developers who are new to Detour, the open-source deferred deep linking SDK by Software Mansion. Use this skill whenever a user asks what Detour is, how to get started with Detour, how to set up deep linking with Detour, how to install the Detour SDK, how to configure the Detour dashboard, or how deferred deep linking works. Also use it when the user has no prior deep linking setup and wants to add deep links to their app. Covers everything from zero to production: account setup, dashboard configuration, Universal Links and App Links, platform SDK integration for React Native, iOS, Android, and Flutter, analytics, and architecture.

Use this Skill: https://skilld.dev/gh/software-mansion-labs/skills/detour-onboarding

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesios.md

≈1.3k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Detour — iOS SDK Reference

Contents

  • Requirements
  • Installation
  • Universal Links
  • Custom URL Scheme (optional)
  • SDK Setup
  • Testing deferred links on iOS
  • Analytics
  • Keeping this reference current

Requirements

  • iOS 13+, Swift 5.5+

Installation

SPM (Xcode): File > Add Package Dependencies then enter:

https://github.com/software-mansion-labs/ios-detour

Package.swift:

// Pin the current release — check the GitHub releases page / README for the latest version.
.package(url: "https://github.com/software-mansion-labs/ios-detour", from: "LATEST_VERSION")

CocoaPods:

platform :ios, '13.0'
target 'YourAppTarget' do
  use_frameworks!
  pod 'Detour'  # latest; add a version constraint to pin — see the README
end

Then run pod install.


Universal Links

1. Add Associated Domains

Xcode → Signing & Capabilities → Associated Domains:

applinks:YOUR_ORG.godetour.link

App Store Connect: The Associated Domains entitlement must also be enabled in your App ID on App Store Connect (Certificates, Identifiers & Profiles → your App ID → Capabilities → Associated Domains). Without this, the entitlement won't be included in the provisioning profile and Universal Links won't work — even if the entitlements file looks correct locally.

Or in <AppTarget>.entitlements:

<key>com.apple.developer.associated-domains</key>
<array>
  <string>applinks:YOUR_ORG.godetour.link</string>
</array>

2. Handle in AppDelegate

// Universal Link (https://YOUR_ORG.godetour.link/...)
func application(
  _ application: UIApplication,
  continue userActivity: NSUserActivity,
  restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void
) -> Bool {
  guard userActivity.activityType == NSUserActivityTypeBrowsingWeb,
        let url = userActivity.webpageURL else { return false }
  Task { @MainActor in
    let result = await Detour.shared.processLink(url, config: detourConfig)
    handleLink(result)
  }
  return true
}

Custom URL Scheme (optional)

Info.plist:

<key>CFBundleURLTypes</key>
<array>
  <dict>
    <key>CFBundleURLSchemes</key>
    <array><string>yourapp</string></array>
  </dict>
</array>

AppDelegate:

func application(_ app: UIApplication, open url: URL,
  options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
  Task { @MainActor in
    let result = await Detour.shared.processLink(url, config: detourConfig)
    handleLink(result)
  }
  return true
}

SDK Setup

1. Config

import Detour

let detourConfig = DetourConfig(
  apiKey: "YOUR_API_KEY",    // Detour Dashboard → API Configuration
  appID: "YOUR_APP_ID",      // Detour Dashboard → API Configuration
  shouldUseClipboard: true   // improves deferred link matching on iOS
)

2. Cold start — resolveInitialLink

Call in application(_:didFinishLaunchingWithOptions:):

func application(
  _ application: UIApplication,
  didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
  // resolveInitialLink also mounts analytics automatically
  Detour.shared.resolveInitialLink(config: detourConfig, launchOptions: launchOptions) { result in
    self.handleLink(result)
  }
  return true
}

private func handleLink(_ result: DetourResult) {
  guard let link = result.link else { return }

  // link.type:     .deferred | .verified | .scheme
  // link.route:    "/articles/2?ref=campaign"
  // link.pathname: "/articles/2"
  // link.params:   ["ref": "campaign"]

  NotificationCenter.default.post(name: .detourLinkReceived, object: link)
}

SwiftUI / SceneDelegate:

func scene(_ scene: UIScene,
           willConnectTo session: UISceneSession,
           options connectionOptions: UIScene.ConnectionOptions) {
  Detour.shared.resolveInitialLink(
    config: detourConfig,
    connectionOptions: connectionOptions
  ) { result in
    self.handleLink(result)
  }
}

Note: resolveInitialLink mounts analytics automatically — no need to call mountAnalytics separately.


Testing deferred links on iOS

  1. Uninstall the app before clicking the Detour link
  2. Click https://YOUR_ORG.godetour.link/APP_HASH/your/path in Safari on a real device
  3. Install the app, open it — the SDK resolves the link
  4. Each test needs a fresh install — the same deferred link won't fire twice on the same device

For testing, reset the first-launch flag without reinstalling:

Detour.shared.resetSession(allowDeferredRetry: true)

Analytics

// Standard events — use DetourEventName enum
DetourAnalytics.logEvent(.purchase, data: ["revenue": 29.99, "currency": "USD"])
DetourAnalytics.logEvent(.viewItem, data: ["item_id": "article_2"])

// Custom / non-standard activity — use logRetention
DetourAnalytics.logRetention("article_opened")
DetourAnalytics.logRetention("app_open")

Keeping this reference current

If the user asks about the latest version, installation steps, or you suspect anything above may be outdated, fetch the live README:

https://github.com/software-mansion-labs/ios-detour/blob/main/README.md

Cross-reference against the sections above and prefer the live README if they conflict.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning4mo3 checks · Risk SAFE
  • Gen Agent Trust Hub4mo

    The skill is a comprehensive and safe onboarding guide for the Detour deep linking SDK by Software Mansion. It provides standard configuration steps, code integration examples, and testing procedures for Android, iOS, Flutter, and React Native platforms. All external resources, including GitHub repositories and package dependencies, are official vendor-owned assets, and the skill follows security best practices for credential management.

  • Socket4mo

    No alerts

  • Snyk4mo

    Risk: MEDIUM · 1 issue

Signed by skilld at 43cde80. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 weeks ago.

Activeupdated 5 months ago

README badge

README badge for software-mansion-labs/skills/detour-onboarding