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.1 or later
- Swift 6.0 or later
- Xcode 16 or later
Installation
The iOS SDK is distributed via Swift Package Manager.
If you manage dependencies with a
Package.swift file:
Quick example
Initialization
Create a singleUplink instance in your app and use it to spawn workers.
uplink.worker(controller:)
Creates a new Worker bound to a UIViewController. The SDK uses the controller to host its WKWebView, so pass the view controller that should own the SDK’s browser surface (typically the one currently on screen).
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 if you want the rest of your app to continue running.
Cleanup
worker.close()
Closes the worker and releases its resources.
Complete example
A minimalUIViewController that starts an Uplink worker when it appears:
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