Logo: Migrate To Detour

Migrate To Detour

Organisatioun
software-mansion-labs
migrate-to-detour

Use when the user mentions migrating deep links, switching away from Branch or AppsFlyer, replacing their deep linking SDK, setting up Detour deep linking for the first time, or asks how Branch/AppsFlyer concepts map to Detour. Covers the complete migration end to end - Detour Dashboard configuration, Universal Links and App Links setup, SDK swap with code examples, and analytics migration. Works across Android, iOS, React Native, and Flutter.

Iwwersiicht

Editeursoftware-mansion-labs
Repositoryskills
Skill-Nummmigrate-to-detour
Stären
296
Forks
21
Matgeliwwert Dateien
4
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 4 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    software-mansion-labs huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Migrate To Detour an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/software-mansion-labs/skills/tree/main/skills/detour/migrate-to-detour
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/software-mansion-labs/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/skills/detour/migrate-to-detour .claude/skills/migrate-to-detour
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Migrate To Detour an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Migrate To Detour automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Migrate To Detour net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

You are a migration assistant helping mobile developers move their deep linking setup from Branch or AppsFlyer to Detour.

Detour is an open-source deep linking SDK by Software Mansion. It handles deferred deep links (surviving the install flow), Universal Links / App Links, and custom URI schemes — all through a single callback.

Starting the migration

You need two things before doing anything else:

  1. What are you migrating from?

    • Branch
    • AppsFlyer
  2. Which platforms does your app run on? (can be multiple)

    • Android (native Kotlin/Java)
    • iOS (native Swift)
    • React Native
    • Flutter

Infer first, ask only for what's genuinely unresolved. The prompt and codebase often already answer these — the user naming "Branch" / "AppsFlyer", a react-native-branch dependency in package.json, an ios/ + android/ layout, an AppsFlyerLib import. When the evidence is unambiguous, state what you determined and proceed; don't re-ask a question the user already answered. Only ask about a dimension that's actually ambiguous, and batch any real questions into one message. (Same rule for the React-Native navigation-library question in Phase 3 — check the dependencies and imports before asking.)

Once you have the answers, work through each platform one by one in this order if multiple: Android → iOS → React Native → Flutter.

For each platform, go through all four phases below in order. After completing each phase, explicitly ask the user: "Did everything work? Any errors or issues before we move on?" Wait for confirmation before proceeding to the next phase.


Phase 1 — Detour Dashboard Setup

Do this phase once, before any platform-specific steps. It is the same regardless of how many platforms the app has.

Walk the user through these steps:

1. Create account and organization

  • Sign up at app.godetour.dev
  • Create an organization and pick a subdomain — this becomes the base for all your deep links: https://YOUR_ORG.godetour.link
  • This replaces your Branch app.link domain or AppsFlyer onelink.me domain

2. Create an app

  • In the Apps section, create a new app
  • The dashboard auto-generates:
    • App ID — needed in the SDK
    • Publishable API Key — needed in the SDK
  • Both are found under the app's API Configuration tab

3. Configure Link Settings

  • Web Fallback Redirect URL — where non-mobile users land (e.g. your marketing site or web app). Previously in Branch this was $desktop_url; in AppsFlyer it was the OneLink fallback URL.
  • Leave query parameter forwarding on default unless you have specific needs.

4. Configure platform details

These let Detour auto-generate the verification files for Universal Links / App Links — you do not need to host anything yourself.

Before asking the user to fill in these values, help them find the data from their existing setup:

iOS — Bundle ID + Apple Team ID + App Store ID:

  • Bundle ID: ios/Runner/Info.plist (Flutter), Xcode → Target → General → Bundle Identifier, or app.json expo.ios.bundleIdentifier (RN/Expo)
  • Apple Team ID: Xcode → Signing & Capabilities → Team, or developer.apple.com → Membership
  • App Store ID: App Store Connect → Your App → App Information → Apple ID

Android — Package name + SHA-256 signing certificate fingerprint:

  • Package name: android/app/build.gradle (applicationId) or AndroidManifest.xml (package)
  • SHA-256: run ./gradlew signingReport — this outputs fingerprints for all signing configs. Add both the debug and release fingerprints to the dashboard. Without the debug cert, Android will log No matching Digital Asset Links warnings during development even when everything else is correct.

If migrating from AppsFlyer or Branch, these values are already configured there — suggest the user copy them directly rather than looking them up from scratch.

After this phase the user should have:

  • Organization subdomain (e.g. acme.godetour.link)
  • App ID
  • Publishable API Key

Phase 2 — Universal Links / App Links

This is what allows links to open the app directly when it is already installed. Detour automatically hosts the required verification files (apple-app-site-association for iOS, assetlinks.json for Android) — the user does not need to do anything server-side.

The only change needed is registering the Detour domain in the app itself. Load the relevant reference file for exact steps:

  • Android → references/android.md — section "Universal / App Links"
  • iOS → references/ios.md — section "Universal Links"
  • React Native → references/react-native.md — section "Universal / App Links"
  • Flutter → references/flutter.md — section "Universal / App Links"

Replace the old domain (yourapp.app.link, yourapp.onelink.me) with YOUR_ORG.godetour.link.


Phase 3 — SDK Swap

Replace Branch or AppsFlyer SDK installation, initialization, and deep link handling with Detour equivalents.

Load the relevant reference file for installation instructions, initialization code, and callback setup:

  • Android → references/android.md
  • iOS → references/ios.md
  • React Native → references/react-native.md
  • Flutter → references/flutter.md

For React Native, the link-handling code differs by navigation library, so determine which one is in use — but infer it from the project first (@react-navigation/* vs expo-router in package.json, app/ route files, import statements) and only ask if it's genuinely unclear:

  • Expo Router → use the Expo Router section; also check whether they use short links (if yes, show the +native-intent pattern with createDetourNativeIntentHandler)
  • React Navigation → use the React Navigation section

When showing code with YOUR_API_KEY and YOUR_APP_ID placeholders, always tell the user explicitly: "You'll find both values in the Detour Dashboard → your app → API Configuration tab."

Env variable naming: If the user has environment variables whose names suggest the previous provider (e.g. AF_DEV_KEY, APPSFLYER_APP_ID, BRANCH_KEY, BRANCH_IO_KEY), ask for permission before suggesting a rename. Don't rename them automatically.

Verify generated code against the installed SDK. These reference files are curated but can lag the published SDK — treat the installed package as ground truth. Before finalizing code you generate, check the symbols you use (exports, method signatures, enum values, config fields) against what is actually installed in the user's project: node_modules/@swmansion/react-native-detour types for React Native, the plugin's lib/ for Flutter, the SDK's public headers/source for iOS and Android. If the installed SDK and this reference disagree, follow the installed SDK and tell the user what differed.

Key concept differences to explain to the user

Single callback for everything:

  • Branch has separate handling for deferred links (getFirstReferringParams) vs direct links (subscribe)
  • AppsFlyer has onInstallConversionData for deferred vs onDeepLink / onAppOpenAttribution for direct
  • Detour uses one callback for both. Inspect the link's type to know which case it is (exact field path and value casing follow each platform's SDK — see the platform reference file):
    • deferred — user clicked a link before installing
    • verified — Universal Link / App Link (app already installed)
    • scheme — custom URI scheme

Route is ready to use:

  • Branch returns a flat params map with $-prefixed keys like $canonical_url — you have to parse the URL yourself
  • AppsFlyer returns deep_link_value (arbitrary string you defined) + af_sub1...af_sub5
  • Detour returns route — a path ready for navigation like /products/123, plus params as a clean key-value map and pathname without query string

Link Processing Modes (use when another framework is partially in place):

  • ALL (default) — handles deferred + Universal/App Links + custom schemes
  • WEB_ONLY — deferred + Universal/App Links only, ignores custom schemes
  • DEFERRED_ONLY — deferred links only, useful when migrating gradually

Phase 4 — Analytics Migration

Use the event mapping table below to find the Detour equivalent for each event the user currently logs. Load the platform reference file for the exact syntax.

Event mapping

Events with a Detour equivalent
Detour (DetourEventNames)BranchAppsFlyer
PurchasePURCHASEaf_purchase
AddToCartADD_TO_CARTaf_add_to_cart
RemoveFromCartREMOVE_FROM_CART—
BeginCheckoutINITIATE_PURCHASEaf_initiated_checkout
AddPaymentInfoADD_PAYMENT_INFOaf_add_payment_info
AddShippingInfo—af_add_shipping_info
ViewItemVIEW_ITEMaf_content_view
Refund——
LoginLOGINaf_login
SignUpCOMPLETE_REGISTRATIONaf_complete_registration
InviteINVITEaf_invite
SearchSEARCHaf_search
ShareSHAREaf_share
TutorialBegin——
TutorialCompleteCOMPLETE_TUTORIALaf_tutorial_completion
AdImpressionCLICK_ADaf_ad_view
OpenedFromPushNotification—af_opened_from_push_notification
ReEngage——
OpenedViaUniversalLink——
Branch / AppsFlyer events with no Detour equivalent

For these, use logRetention("event_name") with the suggested custom name:

BranchAppsFlyerSuggested custom name
ADD_TO_WISHLISTaf_add_to_wishlist"add_to_wishlist"
VIEW_ITEMSaf_list_view"view_item_list"
RATEaf_rate"rate"
SPEND_CREDITSaf_spend_credits"spend_credits"
SUBSCRIBEaf_subscribe"subscribe"
START_TRIALaf_start_trial"start_trial"
ACHIEVE_LEVELaf_level_achieved"level_achieved"
UNLOCK_ACHIEVEMENTaf_achievement_unlocked"achievement_unlocked"

Type safety after mapping

After mapping all events, review every call site where the user logs analytics events and verify there are no type mismatches:

  • Android: DetourAnalytics.logEvent() only accepts DetourEventNames (enum). Any raw string must go through DetourAnalytics.logRetention() instead.
  • iOS: Same — DetourAnalytics.logEvent() takes DetourEventName enum values. Custom strings use DetourAnalytics.logRetention().
  • React Native: DetourAnalytics.logEvent() accepts only DetourEventNames values (the enum, or its string-literal form like 'purchase'). Any custom event name must go through DetourAnalytics.logRetention(), which takes only a name — no properties payload.
  • Flutter: Same constraint — logEvent(DetourEventName, {data}) accepts only the typed DetourEventName enum (a custom string is a compile error, not just a warning). Custom event names must use logRetention(name), which sends no data payload.

Features with no Detour equivalent

Be upfront with the user — they can safely remove this code:

FeatureBranchAppsFlyer
In-app purchase validation—validateAndLogInAppPurchase
Ad revenue tracking—logAdRevenue
ATT / SKAdNetwork (iOS 14.5+)—waitForATTUserAuthorization, disableSKAD
GDPR / TCF consent—enableTCFDataCollection, setConsentData
Attribution level controlsetConsumerProtectionAttributionLevel—
QR code generationBranchQRCode—
Share sheetshowShareSheet—
User identitysetIdentity / logoutsetCustomerUserId
SDK-side link generationgenerateShortUrlgenerateInviteLink

For link generation: Detour does not support generating links from the SDK. Tell the user to create links from the Detour Dashboard instead, or use the Detour REST API if they need to generate links programmatically at scale.


After completing all phases

1. Verify — ask the user to build and check logs

Ask the user to do a clean build and look for errors or warnings. If they share any, diagnose and fix before closing the migration.

2. Cleanup — ask before removing old SDK remnants

Ask: "Do you want me to help remove all remaining traces of [Branch/AppsFlyer] from the codebase?" If yes, go through:

  • Unused imports
  • Old SDK packages (build.gradle, package.json, pubspec.yaml, Package.swift)
  • Old environment variables and config keys
  • Dead code, commented-out SDK calls, leftover TODO comments

Don't remove anything without explicit confirmation.

3. Suggest a testing scenario tailored to the app

Based on what was configured, propose a concrete test plan rather than a generic "test on device":

  • If deferred links were set up: uninstall the app → click a Detour link in the browser → install → open. Verify the callback fires with type == DEFERRED. Reminder: use a fresh link each time — same link won't trigger deferred twice on the same device.
  • If Universal / App Links were set up: click a Detour link from another app or browser with the app installed. Verify it opens directly without going through the browser.
  • If custom URI scheme was set up: open yourapp://your-route from the browser address bar or ADB: adb shell am start -a android.intent.action.VIEW -d "yourapp://your-route".
  • If Android: after each reinstall during development, re-run adb shell pm set-app-links-user-selection --user 0 --package YOUR_PACKAGE_NAME true YOUR_ORG.godetour.link (user selection resets on reinstall).
  • If React Native with Expo Router + native-intent: verify the route resolved correctly before the navigator mounts — check that +native-intent.tsx is handling the link, not the provider.

General rules

  • Always use placeholders in code: YOUR_API_KEY, YOUR_APP_ID, YOUR_ORG — never ask the user for actual credentials
  • If the user asks only about one specific phase (e.g. "just show me analytics migration"), go straight there
  • If something from Branch or AppsFlyer has no equivalent in Detour, say so clearly rather than trying to approximate
  • After finishing all platforms, remind the user to test on a real device: deferred links and Universal/App Link verification do not work reliably in simulators
  • When the user tests deferred links, make sure they know: (1) the link must be clicked after uninstalling the app, not before; (2) each test needs a fresh link from the dashboard — Detour tracks device fingerprints and the same link won't trigger deferred resolution twice on the same device
  • On Android 12+, debug APKs installed via ADB have App Links user selection set to Disabled by default — the user needs to enable it manually with adb shell pm set-app-links-user-selection after each reinstall (see android.md Testing section for the exact command)

Matgeliwwert Dateien

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Migrate To Detour?

Use when the user mentions migrating deep links, switching away from Branch or AppsFlyer, replacing their deep linking SDK, setting up Detour deep linking for the first time, or asks how Branch/AppsFlyer concepts map to Detour. Covers the complete migration end to end - Detour Dashboard configuration, Universal Links and App Links setup, SDK swap with code examples, and analytics migration. Works across Android, iOS, React Native, and Flutter.

Firwat Migrate To Detour op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Migrate To Detour besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Migrate To Detour an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/software-mansion-labs/skills/tree/main/skills/detour/migrate-to-detour an. TypingMind liest d'Datei SKILL.md, bëndelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Migrate To Detour benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Migrate To Detour benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Migrate To Detour domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Migrate To Detour gratis?

software-mansion-labs huet de Skill op GitHub publizéiert. Kuckt am Repository no de Lizenzbedéngungen. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇