How amazon-connect/amazon-connect-chat-ios works
Amazon Connect Chat SDK for iOS manages a chat session and its client-side communications; the integrating app’s backend must first initiate the contact and provide the resulting chat details. The principal flow is app → ChatSession → ChatService, which establishes the participant connection and WebSocket, then exposes transcript updates and chat actions. Separate capabilities include attachments, receipts, lifecycle events, and metrics. The tree identifies additional network and model modules, but their detailed wiring is not shown in the sampled source, so those links are limited to documented or directly evidenced relationships.
Main entry points: ChatService.swift ChatService · WebSocketManager.swift WebSocket manager · ChatSession.swift ChatSession · AWSClient.swift Participant client
Components 20
Session API
- ChatSession
Sources/Core/Service/ChatSession.swift - ChatService
Sources/Core/Service/ChatService.swift - Global configuration
Sources/Core/Models/GlobalConfig.swift - Connection details
Sources/Core/Models/ConnectionDetails.swift - Chat details
Sources/Core/Models/ChatDetails.swift
Chat capabilities
- Transcript handling
Sources/Core/Models/TranscriptItem.swift - Messages and events
Sources/Core/Models/Message.swift - Receipt batching
Sources/Core/Network/MessageReceiptsManager.swift - Attachment types
Sources/Core/Models/AttachmentTypes.swift
Connections
- Participant client
Sources/Core/Network/AWSClient.swift - Participant adapter
Sources/Core/Network/AWSConnectParticipantAdapter.swift - WebSocket manager
Sources/Core/Network/WebSocketManager.swift - Heartbeat manager
Sources/Core/Network/HeartbeatManager.swift - Network manager
Sources/Core/Network/NetworkConnectionManager.swift
Shared support
- Metrics manager
Sources/Core/Network/MetricsManager.swift - API client
Sources/Core/Network/APIClient.swift - SDK logger
Sources/Core/Utils/Logger/SDKLogger.swift
Other components
- Integrating app
- Chat backend
- Participant service
Connections 17
- Chat backend → Integrating app: provides chat details
- Integrating app → ChatSession: configures and uses
- ChatSession → ChatService: delegates chat actions
- ChatService → Participant client: creates participant connection
- Participant client → Participant service: calls participant APIs
- ChatService → WebSocket manager: sets up session transport
- WebSocket manager → Heartbeat manager: starts heartbeats
- WebSocket manager → Network manager: observes connectivity
- WebSocket manager → ChatService: requests refreshed connection
- ChatService → Receipt batching: batches receipts
- ChatService → Transcript handling: publishes transcript items
- ChatService → Messages and events: handles messages and events
- ChatService → Attachment types: supports attachment exchange
- Metrics manager → API client: sends metrics
- ChatSession → Global configuration: accepts configuration
- ChatService → Chat details: uses session details
- Participant client → Participant adapter: uses participant adapter