Skip to main content
Documentation
SDKsiOS

iOS SDK

Integrate the WarpLink iOS SDK with Swift Package Manager to add Universal Links, deferred deep links, and install attribution.

Requirements: iOS 15+, Swift 5.9+, Xcode 15+. Confirm Universal Links on a physical device: the Simulator opens them only through xcrun simctl openurl.

Installation

  1. Go to File > Add Package Dependencies...
  2. Enter: https://github.com/WarpLinkApp/warplink-ios-sdk
  3. Select Up to Next Major Version and click Add Package
  1. In Xcode, select your app target > Signing & Capabilities
  2. Click + Capability > Associated Domains
  3. Add: applinks:yourapp.aplnk.to (find your app's subdomain in the dashboard: open the app, then Settings, or see Your app's own link address)

Also enable Associated Domains in your App ID at developer.apple.com.

Serving links from a custom domain? Add an entry for it too (applinks:links.yourapp.com), then declare it to the SDK.

Every app has its own subdomain, yourapp.aplnk.to. Add that exact host, never a wildcard such as applinks:*.aplnk.to. If your app existed before subdomains, keep aplnk.to listed next to the new address: links you already have stay on aplnk.to and keep opening your app. See Your app's own link address.

Initialize the SDK

Call configure() as early as possible in your app lifecycle. Pass an onLink callback and the SDK wires up cold start, warm start, and the deferred deep link check automatically. Your one callback receives every resolved link.

The credential below is an SDK key, created in the dashboard under Keys > SDK keys. Configure the SDK with an SDK key, since only an SDK key records installs. If your organization has several apps, create the key for this app: a key tied to one app is refused for any other app with KEY_APP_MISMATCH.

Your onLink callback only fires for a real resolved link or an error. A deferred check that finds no match is not delivered to onLink, so the automatic sink stays quiet when there is nothing to route. Everything is dispatched on the main thread.

Deliver Incoming URLs

The SDK still needs the tapped URL from the OS. Pick one of these (no swizzling):

  • Drop-in delegate: set your scene delegate class to WarpLinkSceneDelegate (or app delegate to WarpLinkAppDelegate) and the SDK forwards Universal Links for you.
  • One-liner: if you keep your own delegate, forward the activity or URL:

That is the entire host integration. Resolution and the onLink dispatch are automatic.

Opt Out of Automatic Handling

Every piece is on by default. Disable what you want to drive yourself:

The SDK always recognizes aplnk.to. Tell it about your app's own subdomain, yourapp.aplnk.to, and any custom domain you serve links from. Then a link on those hosts resolves on the very first launch, with no network round trip.

This matters because the decision is synchronous. WarpLink.open(_:) returns a Bool the instant the OS hands over a URL, so it can only answer from what it already knows. A domain the SDK has not been told about is reported as not ours and handed back to your router, which is exactly what a fresh install looks like before the SDK has ever reached the server.

Declare them in code:

Or declare them with no code at all, in Info.plist:

Both forms are optional and both are additive. The SDK uses the union of aplnk.to, linkDomains, the WarpLinkDomains array, and the domains it learns from the server. Declare your app's subdomain so a link on it resolves on a fresh install.

Entries are normalized for you: whitespace is trimmed, the value is lowercased, and a full URL is reduced to its host, so https://Links.YourApp.com/ and links.yourapp.com mean the same thing. www. is left alone, because www.yourapp.com and yourapp.com are different hosts.

Cold and warm start are handled for you once URLs reach the SDK. See Deep Links for the delegate options and the manual path.

The deferred check fires automatically from configure() and delivers its result to onLink. See Deferred Deep Links for details and the manual path.

  1. Build and run on a physical device
  2. Paste your test link (e.g., https://yourapp.aplnk.to/abc123) into Notes or Messages and tap it. Typing it into the Safari address bar never opens the app.
  3. The app should open and trigger the deep link callback
  4. Check Xcode console for [WarpLink] log messages

On the iOS Simulator, xcrun simctl openurl booted https://yourapp.aplnk.to/abc123 opens the app only when its Associated Domains entitlement lists the host and the domain serves a valid apple-app-site-association file that matches the path, and because tapping a link inside the Simulator is unreliable, confirm the iOS path on a physical device before you ship.

Next Steps