ClarioDesk. Reads are replay-last AsyncStreams
(a new iterator immediately receives the current value, then live updates),
with closure-based subscribe* variants for UIKit hosts that return a
cancellable ClarioSubscription.
Lifecycle
initialize
App.init or
application(_:didFinishLaunchingWithOptions:) with no await. Every
subsequent method awaits the shared bootstrap internally, so nothing races.
First launch generates the Secure Enclave device key and registers the device;
later launches reuse it.
ClarioDeskOptions — only apiKey is required:
identify
clearIdentity() before Verified-identity logout/account switch.
reset
initialize registers a
fresh device.
State & diagnostics
Tickets & messages
createTicket
sendMessage
retryMessage
message.failed == true).
Tap-to-retry only; never auto-retried.
One-shot fetches
Read & typing
Bug reports
submitBugReport
type: .bug: the subject is derived
from the description (first line, ≤60 chars — the user never types a title),
the logCollector output (if wired in options) is attached as
clariodesk-logs.txt, and the optional screenshot rides along. One-shot — no
outbox; surface failure with tap-to-retry.
The prebuilt ClarioDeskWidgets.openBugReport() auto-captures a screenshot
and calls this for you (see prebuilt UI, including
opt-in shake-to-report); headless hosts call it directly.
CSAT
submitCsat
Ticket
(csatScore / csatComment / hasCsat).
Attachments
Push
Reactive reads
Streams that can carry a load failure are throwing; the rest are plainAsyncStreams. Subscribing before initialize throws .notInitialized on
first await.
Closure subscriptions (UIKit)
Same semantics; each returns aClarioSubscription — call .cancel() when
done.
Types
All models areSendable value types: Ticket, Message, Attachment,
OutgoingAttachment, NotificationPreferences, ClarioPushPayload,
ClarioDeskError, and the enums above (TicketType, TicketStatus,
MessageAuthor, AttachmentKind, MessageReadState).
This SDK implements the same wire contract as the
Flutter and
React Native SDKs — identical bytes on the
wire and the same state machines, expressed in Swift idioms (
initialize
instead of init, tuples for create results, AsyncStream reads).