What you’ll build
In this quickstart you will:- Install the Desmo iOS SDK via Swift Package Manager.
- Initialize the SDK with your publishable key.
- Start and stop a delivery session from your app.
pk_....If you don’t have a key yet, contact your Desmo representative to have one issued for your project.
Requirements
- iOS 15.0 or later
- Xcode 15 or later
- Swift 5.9 or later
App permissions
To let Desmo record sessions correctly, your app should request:- Location – so sessions can be tied to where the delivery happened.
- Motion & Fitness – so Desmo can interpret movement patterns during the session.
Info.plist with user-facing explanations that match your product:
1. Install the SDK (Swift Package Manager)
You can add the SDK either through Xcode or by editing your ownPackage.swift.
Option 1 – Add via Xcode UI
- In Xcode, open your app project.
- Go to File → Add Package Dependencies…
-
In the search field, paste the package URL:
-
When prompted for Dependency Rule, choose:
- Version → “Up to Next Major”
- Starting from:
0.1.1
-
Select the product
DesmoTraceSDKfor your app target and finish.
Option 2 – Add to Package.swift
If you use SwiftPM directly, add this to your app’s Package.swift:
2. Initialize the SDK
CallDesmo.setup once at app startup, usually in your App’s init or in your AppDelegate.
key: your publishable Desmo API key (starts withpk_).environment:.sandbox– Desmo sandbox environment..live– Desmo production environment.
Desmo.setup fails (for example, if the key does not start with pk_), the SDK will log an error and Desmo.shared will remain nil.
3. Start a delivery session
Call this when you begin recording a delivery (for example, when the driver starts a drop-off):- Calls Desmo’s backend to create a session.
- Starts collecting telemetry on-device.
- Begins batching telemetry to Desmo while the session is recording.
4. Stop a delivery session
Call this when the delivery is complete:- Flushes any remaining telemetry.
- Notifies the backend that the session is complete.
- Lets Desmo’s workers start processing PoD intelligence for that session.
Next steps
From here:- Configure keys and environments in Auth & Environments.
- Enable logging and troubleshoot in Logging, Debugging & Troubleshooting.
- Revisit the Desmo Integration Overview at Integrating Desmo to see how the iOS SDK fits with your backend APIs and dashboard.