Logo Migrate To Detour

Migrate To Detour

Tổ chức
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.

Tổng quan

Nhà phát hànhsoftware-mansion-labs
Kho mãskills
Tên kỹ năngmigrate-to-detour
Sao
296
Bản fork
21
Tệp đi kèm
4
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 4 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được software-mansion-labs công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Migrate To Detour trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/software-mansion-labs/skills/tree/main/skills/detour/migrate-to-detour
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

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
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Migrate To Detour trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Migrate To Detour ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Migrate To Detour với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

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)

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Migrate To Detour làm được gì?

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.

Vì sao nên dùng Migrate To Detour trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Migrate To Detour là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Migrate To Detour trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/software-mansion-labs/skills/tree/main/skills/detour/migrate-to-detour. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Migrate To Detour?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Migrate To Detour với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Migrate To Detour với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Migrate To Detour có miễn phí không?

Kỹ năng này được software-mansion-labs phát hành trên GitHub. Hãy xem điều khoản giấy phép trong kho mã. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇