Key concepts:
- Device: A physical iOS device running your app
- Worker: A worker created by the Uplink SDK inside your app (one app can create multiple workers)
- Session: An authenticated connection that pairs your worker with a JavaScript SDK client
Requirements
- iOS 15.0 or later
- Xcode 26.1 or later
Installation
The iOS SDK is distributed via Swift Package Manager.1
Add the package
In Xcode, go to File → Add Package Dependencies… and enter:
2
Select a framework variant
Choose either the static
Uplink library product or the Uplink-Dynamic library product and add it to your app target. Link only one variant.3
Import the module
Package.swift file:
Uplink is static by default. If your app requires dynamic linking, depend on .product(name: "Uplink-Dynamic", package: "uplink-ios-public") instead. Do not link both variants.
Quick example
Initialization
Create aWorker with the UIViewController that will present the browser, usually the view controller currently on screen. Retain each active worker for as long as its connection is active.
Worker(controller:)
Creates a new Worker associated with a UIViewController. The SDK uses that controller to host its WKWebView.
controller: TheUIViewControllerthat will host the SDK’s web view
Worker ready to connect to a session
Obtaining a session
Your backend creates a session using the JavaScript SDK’suplink.session() and delivers the resulting session URL to the app. How you deliver it — a backend API response, a universal link, a QR code — is up to you.
Connecting and accepting
worker.connect(session:)
Connects the worker to an Uplink session.
session: The session URL provided by your backend
worker.accept()
Begins accepting commands from the JavaScript SDK client. accept() suspends until the worker closes, so call it from a Task to avoid blocking the rest of your app.
worker.watch(_:)
Registers a callback for worker events.
Callbacks are not delivered on the MainActor. If a callback updates UIKit or other main-actor-isolated state, explicitly hop to the main actor.
Cleanup
worker.close()
Closes the worker and releases its resources.
Complete example
A minimalUIViewController that starts an Uplink worker when it appears:
For a complete working app, see the Connect example.
Related
Android SDK
Integrate Uplink into your Android app
JavaScript SDK
Control your worker from server-side code
Sessions
How sessions are created and secured
Core concepts
Architecture overview