Flinku Docs

iOS SDK (Swift)

Swift Package Manager distribution with Universal Links support.

Installation

text
Repository: https://github.com/flinku-dev/ios-sdk
Dependency Rule: Exact Version: 0.7.1

Add your project host under Associated Domains: applinks:yourapp.flku.dev.

Configure

MyApp.swift
@main
struct MyApp: App {
init() {
Flinku.configure(baseUrl: "https://yourapp.flku.dev")
}
}

Pass readClipboard: false if your app uses Universal Links for attribution and you want to suppress the iOS paste permission dialog. Defaults to true.

match()

match() recovers deferred install attribution. It is not your Universal Link / URI scheme handler. If your app already routes a launch URL, do not let a deferred match() result overwrite it — call match() only when no launch URL is present. See Apps that already handle their own deep links.

swift
let link = await Flinku.match()
if link.matched {
// link.deepLink, link.params
}

reset()

swift
Flinku.reset()

Clears the cached match result only (removes the two match keys). Does not clear the stored user id or pending referral attribution. This changed in 0.6.0.

resetAll()

swift
Flinku.resetAll()

Clears everything reset() clears, plus the stored user id, referral project id, all pending referral records, and any tracked-once markers. Testing only — do not call in production. Calling it in production destroys real referral attribution. Added in 0.7.0.

swift
var options = FlinkuLinkOptions(title: "Summer Campaign")
options.deepLink = "yourapp://promo"
options.params = ["ref": "instagram"]
 
flinku.createLink(options) { result in
switch result {
case .success(let link):
print(link.shortUrl)
case .failure(let error):
print(error)
}
}

Returns the short URL instantly without waiting for the server. The link is saved in the background. Use this for share buttons where speed matters.

If the background save fails on a transient error (network, timeout, 5xx, or 429), the SDK retries up to three times with 1s, 2s, and 4s delays. A URL shared immediately can still 404 for up to roughly 7 seconds while retries run. Enable debug logging in Flinku.configure(..., debug: true) to surface terminal failures in the console.

⚠️ Do not wrap createLinkInstant in an async function. It is synchronous and returns immediately. Wrapping it in async/await will add unnecessary delay and defeat the purpose.

swift
var options = FlinkuLinkOptions(title: "Summer Campaign")
options.deepLink = "yourapp://promo"
options.params = ["ref": "instagram"]
 
let link = try Flinku.createLinkInstant(options)
let activityVC = UIActivityViewController(
activityItems: [link.shortUrl],
applicationActivities: nil
)
// Present activityVC from your view controller