Trigger Dialogue
A dialogue is a conversation flow built in your bot. Trigger one to start it from your app, for example from a help button on a checkout screen
Show the chat with a dialogue
Pass the dialogue id when you show the chat, and the dialogue starts as the chat opens
KindlyWebViewSDK.displayChat(triggerDialogueId: "DIALOGUE_ID")This works on the first display too, before any chat page exists. Pass a languageCode with it to start the dialogue in that language, see Launch Chat. On a new chat page the dialogue's reply often arrives before the chat first renders, and then comes without a message event, see Events
Trigger a dialogue without showing the chat
KindlyWebViewSDK.triggerDialogue(id: "DIALOGUE_ID")While the chat is displayed, the dialogue runs in front of the user. While it is hidden, the dialogue runs without opening it, and the user sees it the next time the chat is shown. A page that is still loading starts the dialogue once it has loaded
triggerDialogue needs a chat page, so show the chat at least once first. Without one the call does nothing, and the SDK logs an error on iOS and a warning on Android. The Flutter and React Native calls still complete without an error then
Dialogue ids
A dialogue id is 1 to 128 letters, digits, _ and -, and surrounding whitespace is trimmed in Flutter and React Native. On iOS and Android an id in another format is refused with an error in the log. Flutter throws an ArgumentError and React Native rejects with INVALID_ARGUMENT, before anything reaches the chat