UnbluConversationInterceptor
public protocol UnbluConversationInterceptor
A protocol that defines an object that can intercept certain conversation related events.
-
Called when a new conversation is preparing. It enables you to intercept custom visitorData and mutate it before the conversation is created.
Declaration
Swift
func conversationIsPreparing(withType conversationType: ConversationType, customVisitorData: String?, onComplete: @escaping (String?) -> Void)Parameters
conversationTypeThe
ConversationTypefor the new conversationcustomVisitorDataCustom “visitorData” (String) that was included when an instruction was received to start a new conversation (optional).
onCompleteThe callback to call with the custom visitorData you want to pass back to Unblu. This must be called.
-
conversationDidRequestOpenExternalLink(withUrl:Default implementation) Called when a link is tapped in a conversation. It enables you to inspect the link and return an action for Unblu to take. The default handler for this returns
UnbluExternalLinkHandleAction.open.Default Implementation
Declaration
Swift
func conversationDidRequestOpenExternalLink(withUrl url: URL) -> UnbluExternalLinkHandleActionParameters
urlThe
URLof the link to open.Return Value
The
UnbluExternalLinkHandleActionthat Unblu will perform.
UnbluConversationInterceptor Protocol Reference