BotsMessageServiceDelegate
public protocol BotsMessageServiceDelegate : AnyObject
Classes which conform to this protocol have a access to a set of methods which enable the user to optionally modify the message payloads
-
A delegate method which allows the user to modify the message payload object before sending it.
Declaration
Swift
func beforeSend(message: [String : Any]?) -> [String : Any]?
Parameters
message
the message payload which can be modified before sending to the chat server.
Return Value
the message payload to be sent to the chat server.
-
A delegate method which allows the user to modify the message payload before it is rendered on the chat screen.
Declaration
Swift
func beforeDisplay(message: [String : Any]?) -> [String : Any]?
Parameters
message
the message payload which can be modified before it is rendered on the chat view.
Return Value
the message payload to rendered on the chat view.
-
A delegate method which allows the user to modify the action message payload before sending it.
Declaration
Swift
func beforeSendPostback(action: [String : Any]?) -> [String : Any]?
Parameters
action
the postback action payload which can be modified before sending it to the chat server.
Return Value
the action payload to be sent to the chat server.
-
A callback method triggered when end conversation session is invoked.
Declaration
Swift
func beforeEndConversation(message: [String : Any], completionHandler: @escaping (_ message: [String : Any], _ status: EndConversationStatus) -> Void)
Parameters
completionHandler
Implementing class should return success or failure through the completion handler when the function completes