Current SDK release: 0.2.16 (September 2026).
LinkMe iOS SDK
Deep linking, deferred deep linking, and attribution for iOS apps.
Quick start
1. Prerequisites
- A LinkMe account with at least one app configured
- iOS bundle ID and Apple Team ID added in the LinkMe portal
- API keys (
appIdandappKey) from App Settings > API Keys
2. Install
Swift Package Manager (recommended; iOS 14+; macOS 10.15+):
- In Xcode: File > Add Packages...
- Enter
https://github.com/r-dev-limited/li-nk.me-ios-sdk - Select
v0.2.16or a later version tag and addLinkMeKitto your app target. The package manifest is at the repository root.
CocoaPods (legacy):
The v0.2.16 source release is available directly from Git while its CocoaPods trunk spec is being published:
pod 'LinkMeKit', :git => 'https://github.com/r-dev-limited/li-nk.me-ios-sdk.git', :tag => 'v0.2.16'
The current CocoaPods registry spec is pending publication; use SwiftPM or the Git tag above for the current fixes.
3. Configure Universal Links
- In Xcode, enable Signing & Capabilities > Associated Domains and add:
applinks:links.yourco.com
- Add a custom URL scheme in
Info.plist:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>yourapp</string>
</array>
</dict>
</array>
LinkMe hosts the AASA file automatically once your domain is connected.
4. Initialize the SDK
import SwiftUI
import LinkMeKit
@main
struct MyApp: App {
init() {
LinkMe.shared.configure(config: .init(
baseUrl: URL(string: "https://li-nk.me")!,
appId: "your_app_id",
appKey: "your_app_key",
sendDeviceInfo: true,
includeVendorId: true,
includeAdvertisingId: false,
debug: true
))
}
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
5. Handle links
struct ContentView: View {
@State private var message = "Waiting for link…"
@State private var unsubscribe: (() -> Void)?
private func display(_ payload: LinkPayload?) {
guard let payload else { return }
DispatchQueue.main.async { message = "Opened: \(payload.path ?? "/")" }
}
var body: some View {
Text(message)
.onOpenURL { LinkMe.shared.handle(url: $0) }
.onContinueUserActivity(NSUserActivityTypeBrowsingWeb) {
LinkMe.shared.handle(userActivity: $0)
}
.onAppear {
unsubscribe?()
unsubscribe = LinkMe.shared.addListener { display($0) }
LinkMe.shared.getInitialLink { initial in
if initial != nil { display(initial) }
else { LinkMe.shared.claimDeferredIfAvailable { display($0) } }
}
}
.onDisappear { unsubscribe?(); unsubscribe = nil }
}
}
Deferred deep linking
The SDK supports two strategies for first-install attribution:
- Pasteboard (deterministic) — reads a
cidtoken written by the LinkMe Edge interstitial before the App Store redirect. Enable Pasteboard for Deferred Links in App Settings. - Fingerprint (probabilistic fallback) — calls
/api/deferred/claimwhen pasteboard is unavailable.
Both are handled automatically by claimDeferredIfAvailable().
API reference
| Method | Description |
|---|---|
configure(config:) |
Initialize the singleton |
handle(userActivity:) |
Forward NSUserActivity for Universal Links |
handle(url:) |
Forward custom scheme URLs |
getInitialLink(completion:) |
Get the payload that opened the app |
addListener(_:) |
Subscribe to link events (returns unsubscribe closure) |
claimDeferredIfAvailable(completion:) |
Claim deferred deep link on first install |
track(event:properties:) |
Send analytics events |
setUserId(_:) |
Associate a user ID; pass nil to clear it |
setAdvertisingConsent(_:) |
Toggle advertising identifier usage |
setReady() |
Signal readiness to process queued URLs |
Example app
The ExampleApp/ directory contains a runnable SwiftUI sample. Update ExampleApp/Configuration/linkme.env with your keys and run on a device or simulator.
License
Apache-2.0
Call LinkMe.shared.setUserId(nil) on logout. SDK callbacks may arrive off the main thread; dispatch UI updates to the main queue, as above.