Docs

Universal Links setup

Claim your Lander domain with Associated Domains, let Lander host the apple-app-site-association file, and add an optional custom URL scheme.

Universal Links open your app instead of Safari when two things agree: your app says it handles a domain (the Associated Domains entitlement), and the domain says it trusts your app (the apple-app-site-association file, often called the AASA file). Lander hosts the file for you. You add the entitlement.

Before you start

  • You need a paid Apple Developer Program membership. Associated Domains is not available to free personal teams.
  • Know your link domain. Open Build > Domains in the dashboard. Hosted domains are named after your project and organization, for example acme-shop-acme.golander.link. The examples below use acme.golander.link, the domain of Lander's demo project.

Add your iOS app in the dashboard

Open Build > Platforms and fill in the iOS app card:

FieldWhere to find it
Team ID10 characters, for example ABCDE12345. Membership details at developer.apple.com, or next to the team name in Xcode's Signing & Capabilities.
Bundle IDYour app target's bundle identifier, for example com.acme.shop.
App Store ID (optional)The numeric ID in your App Store URL. Used to send people who do not have the app to the store.
URI scheme (optional)Your custom scheme without ://, for example acmeshop. See step 4.

Save. Lander now serves this file on your link domain:

https://acme.golander.link/.well-known/apple-app-site-association
{
  "applinks": {
    "details": [{ "appIDs": ["ABCDE12345.com.acme.shop"], "components": [{ "/": "/*" }] }]
  }
}

Every path on the domain opens your app. Check it is live:

curl -i https://acme.golander.link/.well-known/apple-app-site-association

You should get 200 with Content-Type: application/json. A 404 means no iOS app is saved for this domain yet. Every field of this card is described in Dashboard: Platforms.

Add the Associated Domains capability

In Xcode, select your app target, then Signing & Capabilities. Click + Capability, add Associated Domains, and add an entry with the applinks: prefix and no https://:

applinks:acme.golander.link

Xcode creates (or updates) your entitlements file:

AcmeShop/AcmeShop.entitlements
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>com.apple.developer.associated-domains</key>
	<array>
		<string>applinks:acme.golander.link</string>
	</array>
</dict>
</plist>

All build configurations

Check that Code Signing Entitlements points at this file for every build configuration (Debug and Release, plus any you added) in the target's build settings, or links will work in debug and silently fail in your release build.

If you also use a custom domain, add one applinks: entry per domain. Lander serves the file on every verified domain of the project.

iOS delivers a Universal Link as an NSUserActivity of type NSUserActivityTypeBrowsingWeb. Pass it to Lander.handle(userActivity:) wherever your app receives it. Pick the tab that matches your app's lifecycle:

AcmeShopApp.swift
WindowGroup {
  ContentView()
    .onContinueUserActivity(NSUserActivityTypeBrowsingWeb) { Lander.handle(userActivity: $0) }
    .onOpenURL { Lander.handle(url: $0) } // custom scheme, step 4
}

SwiftUI calls these on cold start and warm start alike.

Full examples, including routing, are in Receiving links.

A custom scheme such as acmeshop:// is a fallback that always opens the app. It matters most if you use Lander's Continue in app page: iOS keeps a Universal Link tapped on a page of the same domain inside Safari, so that page's "open it" button uses your scheme when you have one. The button opens acmeshop://<path>?lander_link=<short link>, and the SDK resolves the short link carried in lander_link.

Add the scheme in your target's Info > URL Types, or in Info.plist:

AcmeShop/Info.plist
<key>CFBundleURLTypes</key>
<array>
	<dict>
		<key>CFBundleURLName</key>
		<string>com.acme.shop</string>
		<key>CFBundleURLSchemes</key>
		<array>
			<string>acmeshop</string>
		</array>
	</dict>
</array>

Then enter the same scheme (acmeshop) as the URI scheme of your iOS app in Build > Platforms. Lowercase letters, digits, +, . and - only, starting with a letter.

Custom scheme URLs reach Lander.handle(url:) through .onOpenURL, scene(_:openURLContexts:) or application(_:open:options:), and are delivered without a network call. acmeshop://product/123 routes to /product/123 (the host counts as the first path segment).

Local development over HTTP

Only needed if you point the SDK at a Lander API running on your machine (http://localhost:8787). App Transport Security blocks plain HTTP by default, so allow local networking in your debug build:

AcmeShop/Info.plist
<key>NSAppTransportSecurity</key>
<dict>
	<key>NSAllowsLocalNetworking</key>
	<true/>
</dict>

Try it

Build and run on a device or simulator, then open a link from the terminal:

xcrun simctl openurl booted "https://acme.golander.link/p-123"

A Universal Link only opens the app on the simulator when iOS has fetched the domain's apple-app-site-association file. If Safari opens instead, try the custom scheme (xcrun simctl openurl booted "acmeshop://product/123") to check your routing, and see Troubleshooting for the domain side.

On this page