Chat Transcript
Table of contents
Overview
Transcript management is out of the SDKs scope.
The SDK enables the host App to provide its own implementation to store, and maintain an updated chat transcript, by listening to triggered events whenever chat elements changes.
The ChatElementDelegate
enables you to handle the different messages (incomming message, outgoing message…). The application can then take these messages and perform the desired action. The delegate mentioned above is only an enabler for app developers to use to implement any desired action on the messages, for example: print to the screen or download.
In the example provided below, the chat messages are collected and then the application can take the file and download it.
You can checkout an implementation example here.
How is it done
The hosting App provides a ChatElementDelegate
implementation, on ChatController
creation. The hosting App interacts with this delegate in order to be notified when message was attached to the chat.
- Notifies of an addition of chat element to the chat.
CallingChatEleChatElementDelegatementListener.didReceive
Basic Implementation
ChatController
- Use this class to setChatElementDelegate
.
Register To Delegate
override func viewDidLoad() {
controller.chatElementDelegate = self
}
Implement ChatElementDelegate
extension TranscriptDemoViewController: ChatElementDelegate {
func didReceive(_ item: StorableChatElement!) {
print("receive")
}
}