iOS SDK reference
Use this after completing the iOS setup tutorial. It lists every public method exposed by LinkMeKit.
Installation
- Swift Package Manager: add
https://github.com/r-dev-limited/li-nk.me-ios-sdkand select tagv0.2.9. - CocoaPods:
pod 'LinkMeKit', '~> 0.2.9'.
Payload shape
LinkMePayload values include:
| Field | Type | Description |
|---|---|---|
linkId |
String? |
Unique short-link identifier. |
path |
String? |
Deep-link path (e.g., /product/42). |
params |
[String: String]? |
Query parameters merged from the click. |
utm |
[String: String]? |
Normalized UTM attributes. |
custom |
[String: String]? |
Any custom metadata saved with the link. |
url |
String? |
Original universal link URL, when available. |
isLinkMe |
Bool? |
true for LinkMe-resolved links, false for basic universal link fallbacks. |
Core API
LinkMe.shared.configure(config:)
Initializes the singleton. Call once during app startup.
| Config field | Type | Notes |
|---|---|---|
appId |
String |
App identifier from the portal. |
appKey |
String? |
Optional; required only if client calls must be authenticated. |
sendDeviceInfo |
Bool |
Default true. |
includeVendorId |
Bool |
Sends identifierForVendor. |
includeAdvertisingId |
Bool |
Leave false until consent is granted; toggle later via setAdvertisingConsent. |
debug |
Bool |
Default false. When true, LinkMeKit logs HTTP and pasteboard activity to the console for troubleshooting. |
getInitialLink(_:)
Returns the payload that opened the app via Universal Links or custom schemes.
LinkMe.shared.getInitialLink { payload in
guard let payload else { return }
routeUser(payload)
}
addListener(_:)
Subscribes to in-app link events. Returns a closure you must call to unsubscribe.
let unsubscribe = LinkMe.shared.addListener { payload in
routeUser(payload)
}
// ...later
unsubscribe()
claimDeferredIfAvailable(_:)
Attempts to match a first-time install to a previous click. Uses pasteboard (if enabled) before falling back to fingerprint matching.
LinkMe.shared.claimDeferredIfAvailable { payload in
guard let payload else { return }
routeUser(payload)
}
handle(userActivity:) and handle(url:)
Forwards NSUserActivity and URL objects from UIApplicationDelegate or SwiftUI modifiers.
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
LinkMe.shared.handle(userActivity: userActivity)
}
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
LinkMe.shared.handle(url: url)
}
track(event:properties:)
Sends lightweight analytics events.
LinkMe.shared.track(event: "open")
LinkMe.shared.track(event: "purchase", properties: ["amount": 9.99])
setAdvertisingConsent(_:)
Toggles whether the SDK may include the advertising identifier in requests.
LinkMe.shared.setAdvertisingConsent(true)
setUserId(_:)
Associates a user identifier with future events.
setReady()
Signals that the app is ready to process queued URLs. Call after consent dialogs or other setup that should complete before link handling begins. Note: configure already sets the SDK to ready by default.
Pasteboard notes
If Pasteboard for Deferred Links is enabled in the portal, the SDK reads a token from the system clipboard during first launch and iOS shows a one-time “pasted from…” banner. This is expected behavior that delivers deterministic deferred attribution.