Skip to content
DL2App

The app-side setup for your link domain

Enter the domain your links use and pick your stack. You get the exact entitlement, manifest block and handler to paste in, with the domain already filled in.

Free. No account, no email.

The host your links use, without https://. Separate several with spaces or commas.

  1. 1. Xcode → Signing & Capabilities → Associated Domains

    Xcode → Signing & Capabilities → Associated Domains
    applinks:go.example.com

    Add one line per domain. Xcode writes them into your .entitlements file, shown next.

  2. 2. YourApp.entitlements

    YourApp.entitlements
    <key>com.apple.developer.associated-domains</key>
    <array>
      <string>applinks:go.example.com</string>
    </array>
  3. 3. SwiftUI: App.swift

    App.swift
    import SwiftUI
    
    @main
    struct MyApp: App {
        var body: some Scene {
            WindowGroup {
                ContentView()
                    // Called for a universal link on a cold start and while the app runs.
                    .onOpenURL { url in
                        Router.shared.open(url)
                    }
            }
        }
    }
  4. 4. UIKit: SceneDelegate.swift

    SceneDelegate.swift
    // SceneDelegate.swift
    func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options: UIScene.ConnectionOptions) {
        // Cold start: the link arrives with the scene.
        if let url = options.userActivities.first(where: { $0.activityType == NSUserActivityTypeBrowsingWeb })?.webpageURL {
            Router.shared.open(url)
        }
    }
    
    func scene(_ scene: UIScene, continue userActivity: NSUserActivity) {
        // The app was already running.
        guard userActivity.activityType == NSUserActivityTypeBrowsingWeb, let url = userActivity.webpageURL else { return }
        Router.shared.open(url)
    }

    Use this instead of the SwiftUI handler if your app has a scene delegate.

The app is half of it

These snippets tell the phone that your app wants links for a domain. The phone only believes it when the domain agrees, by serving two small files: generate them with the AASA generator for iOS and the assetlinks.json generator for Android.

How to test it

  • Tap the link in Notes or a message. A link typed or pasted into the browser's address bar stays in the browser on both platforms, by design.
  • On iOS, long-press the link. If “Open in your app” is offered, the association worked.
  • On Android, run adb shell pm get-app-links your.package and look for verified next to the host.
  • After changing the entitlement or the manifest, install a fresh build. Both are read at install time.

If a link still opens the browser, the link checker tells you which side is wrong.

With DL2App these steps come pre-filled for your project, and the SDKs replace the handler with one listener that also receives the link someone tapped before they installed the app.

Try DL2App free

What people use next

All 15 tools →