Native iOS SDK for BlocLinks deep linking and attribution.
Installation
Add via Swift Package Manager:
// In Xcode: File → Add Package Dependencies
// URL: https://github.com/bloclinks/bloclinks-ios
Or add to your Package.swift:
.package(url: "https://github.com/bloclinks/bloclinks-ios", from: "1.0.0")
Setup
Initialize in your AppDelegate or SwiftUI App:
import BlocLinks
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
BlocLinks.initialize(apiKey: "bl_live_YOUR_API_KEY")
return true
}
}
Getting the deep link path
let deepPath = BlocLinks.getDeepLinkPath()
// Returns: "/product/123" | "/referral/abc" | nil
if let path = deepPath {
// Navigate to the correct screen
navigateTo(path: path)
}
SwiftUI example
import SwiftUI
import BlocLinks
@main
struct BlocLinksApp: App {
@State private var initialPath: String? = nil
init() {
BlocLinks.initialize(apiKey: "bl_live_YOUR_API_KEY")
}
var body: some Scene {
WindowGroup {
ContentView(initialPath: BlocLinks.getDeepLinkPath())
}
}
}