SDK / IOS

Deep linking for iOS apps.

Resolve Universal Link URLs with WilderlinksClient and pass the resulting destination or structured payload into your own navigation flow.

Package

WilderlinksSDK · Swift Package

iOS 13+ · macOS 12+

01 / Install

Add the SDK

Add the local Swift package from the repository. The current Package.swift does not define a released version range.

Xcodetext
git clone https://github.com/hellowilderlinks-cmyk/wilderlinks-sdks.git
# In Xcode: File → Add Package Dependencies → Add Local
# Select the cloned repository's ios directory and link WilderlinksSDK.

02 / Configure

Initialize once

Use the WilderLinks API base URL and add the exact link host configured for your app. Replace links.example.com with that host.

LinkClient.swiftswift
import Foundation
import WilderlinksSDK

let client = WilderlinksClient(
  config: WilderlinksConfig(
    baseURL: URL(string: "https://api.wilderlinks.space")!,
    domains: ["links.example.com"]
  )
)

04 / Deferred matching

Match only tokens your app can access

DeferredMatch.swiftswift
import WilderlinksSDK

func checkClipboardFallback() async {
  let result = await client.checkDeferredInstall()
  if result.matched {
    print(result.deepLinkPayload as Any)
  }
}

  • checkDeferredInstall() looks for a dl_match_token in the pasteboard on UIKit platforms; clipboard availability and persistence depend on OS/user behavior.
  • matchDeferredToken(_:) and matchInstallAttributionToken(_:provider:) exchange tokens the app has already obtained.
  • There is no automatic App Store install-referrer or token recovery in this SDK.

05 / Platform setup

Before testing on a device

  • The package has no verified versioned Git tag in its current Swift Package manifest; add the local ios package directory from the SDK checkout.
  • Enable Associated Domains and configure the matching Universal Link association for your app and host. The SDK only resolves a URL once the OS delivers it to the app.
  • Use the exact source spelling destinationUrl on ResolvedLink.

06 / Security

Keep private credentials server-side

Do not ship organization or private API keys in mobile apps, browser JavaScript, or Unity client builds. Client-side link resolution and authenticated link-management operations have different trust boundaries; keep API-key operations in a trusted server environment.

To create a link in response to an action in your iOS app, send the link details to an endpoint in your own backend using your app’s normal user authentication. That backend must verify the user is allowed to create the link, then call WilderLinks (for example, POST /api/v1/links) with the organization API key held only on the server.

  1. Your app sends the requested destination and link settings to your backend.
  2. Your backend authenticates and authorizes the user, then creates the WilderLinks link.
  3. Your backend returns the generated URL; the app shares or displays it using its platform-appropriate UI.

The native SDKs now expose createLink, createDeepLink, and createShortLink. They require an organization API key with links:write; configure that key only in a trusted runtime, never in a distributed app.

These SDKs do not provide your app’s authenticated link-creation backend endpoint; implement that endpoint in your own backend.

07 / Troubleshooting

When a link does not match

  • If matched is false, check that the incoming URL host is configured in domains and that Universal Links are associated with the app.
  • handleIncomingURL(_:) returns a ResolvedLink rather than navigating. Route using deepLinkPayload or destinationUrl in your app.
  • Network and decode failures are returned as a not-matched result with error populated.

Continue building