SDK Guide

iOS Deep Linking SDK

Native Swift SDK for iOS deep linking. Universal Links with automatic AASA hosting, deferred deep linking, and install attribution. Supports UIKit and SwiftUI.

Quick Start

1

Add via Swift Package Manager

In Xcode: File → Add Package Dependencies → Enter the repository URL:

https://github.com/nicklausmonroe/ulink-ios-sdk
2

Add Associated Domains

  1. Select your target in Xcode → Signing & Capabilities
  2. Click "+ Capability" → Add "Associated Domains"
  3. Add your domain:
applinks:yourapp.ulink.ly
3

Initialize (UIKit)

import ULink

@main
class AppDelegate: UIResponder, UIApplicationDelegate {

    func application(
        _ application: UIApplication,
        didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
    ) -> Bool {

        ULink.configure(apiKey: "your-api-key")

        return true
    }

    func application(
        _ application: UIApplication,
        continue userActivity: NSUserActivity,
        restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void
    ) -> Bool {

        if let url = userActivity.webpageURL {
            ULink.handleLink(url) { link in
                // Route user based on link.path and link.parameters
            }
            return true
        }
        return false
    }
}
3

Alternative: Initialize (SwiftUI)

import SwiftUI
import ULink

@main
struct MyApp: App {

    init() {
        ULink.configure(apiKey: "your-api-key")
    }

    var body: some Scene {
        WindowGroup {
            ContentView()
                .onOpenURL { url in
                    ULink.handleLink(url) { link in
                        // Route user based on link
                    }
                }
        }
    }
}
4

Handle deferred deep links

// Call on first launch to get link from pre-install click
ULink.getInitialLink { link in
    guard let link = link else { return }

    // User came from a link before installing
    let referralCode = link.parameters["ref"]
    let productId = link.parameters["product"]

    // Navigate to appropriate content
}

Universal Links

Universal Links are Apple's native deep linking mechanism. When properly configured, tapping a Universal Link opens your app directly without showing a browser.

ULink handles the hard parts:

  • AASA (apple-app-site-association) file hosting and updates
  • Automatic SSL certificate management
  • CDN distribution for fast AASA fetches
  • Fallback handling when app isn't installed

iOS 17+ Note

iOS 17 introduced Link Tracking Protection in Safari and Mail. ULink is designed to work with these privacy features. For best results, avoid URL parameters that look like tracking IDs (e.g., fbclid, gclid). Use ULink's built-in parameter encoding instead.

Deferred Deep Linking

Deferred deep linking preserves link context when a user doesn't have your app installed. ULink stores the link data and delivers it after the user installs and opens your app.

Use cases:

  • Referral programs: Credit the referrer even for new installs
  • Content sharing: Open specific content after install
  • Marketing campaigns: Track which ad drove the install
  • Personalized onboarding: Customize first-launch experience

Frequently Asked Questions

Ready to add deep linking to iOS?

Create a free account and get your API key. Most teams integrate in under 30 minutes.