Enabling SDK logging
The Desmo iOS SDK includes lightweight logging to help you understand what it’s doing. Logging is controlled by theloggingEnabled flag on DesmoConfig, which defaults to true. When enabled, the SDK prints messages such as:
- When
Desmo.setupsucceeds or fails. - When sessions start and stop.
- When HTTP requests are sent and responses are received.
DesmoConfig with loggingEnabled: false.
Where logs appear
Logs are printed usingprint, so they show up in:
- Xcode’s Debug area when you run the app from Xcode.
- Device logs when attached to Xcode or collected via your logging pipeline.
Debugging common issues
1. Desmo shared is nil
Symptom:
- Your code prints
"Desmo SDK is not configured"fromguard let client = Desmo.shared else { ... }.
-
Ensure
Desmo.setupis called:- Exactly once.
- Early in the app lifecycle (e.g. in
@mainappinitor AppDelegate).
-
Confirm the key starts with
pk_and is not empty. -
Look for a log like:
2. Session start fails
Symptom:-
startSessionthrows an error. -
You may see an HTTP status code in logs, for example:
- Confirm the publishable key you are using is:
- Valid and not revoked.
- Created for the environment you selected (
sandboxvslive).
- Confirm the device has network connectivity.
- Check your backend/logs for more detailed error messages tied to that key.
3. Session stop fails
Symptom:stopSessionthrows an error.
- Flushes telemetry via
telemetry.flush()andtelemetry.stop()before notifying Desmo’s backend that the session should stop. - If the network call fails, it keeps the internal state as recording so you can retry
stopSession().
- Try stopping again once connectivity is restored.
- Inspect logs for HTTP status codes or network errors.
4. No data appears in Desmo
Symptom:startSessionandstopSessionsucceed, but you don’t see sessions/insights in Desmo.
- Confirm you are using the same environment and tenant as the dashboard you’re looking at.
- Check for any rate limiting or 4xx/5xx errors in the logs.
- Share session IDs from your logs with the Desmo team to trace them end-to-end.
Integration checklist
Use this as a quick pre-flight check before shipping:- Setup
-
Desmo.setupis called exactly once at app startup. - You use a publishable key starting with
pk_. - The environment (
.sandbox/.live) matches the keys you created.
-
- Session lifecycle
-
startSessionis called when a delivery begins. -
stopSessionis called when the delivery completes. - Both calls succeed without throwing in your test flows.
-
- Logging
- Logging is enabled in sandbox builds.
- You can see Desmo SDK logs in Xcode when starting and stopping sessions.
- Backend visibility
- You can see created sessions in the Desmo dashboard or API using the same environment and tenant.