Conversation
Launching chat screen
Open the chat screen by calling the below function:
KommunicateFlutterPlugin.openConversations();
Launching individual chat thread
Open an individual chat thread by calling the below function and passing the clientChannelKey
the clientChannelKey is retrieved from the buildConversation
method "Success"
response message object.
KommunicateFlutterPlugin.openParticularConversation(<CLIENT_CHANNEL_KEY>);
Starting a new Conversation
Start a new conversation by using the below function:
dynamic conversationObject = {
'appId': <APP_ID>,
'isSingleConversation' : false
};
KommunicateFlutterPlugin.buildConversation(conversationObject)
.then((result) {
print("Conversation builder success: " + result.toString()); //result.toString() will be the clientChannelKey
}).catchError((error) {
print("Conversation builder error occurred : " + error.toString());
});
Having the list of agentIds and botIds, one can pass it in the below conversation object to create the conversation use the below method:
dynamic conversationObject = {
'appId': <APP_ID>,
'isSingleConversation' : false,
'agentIds':['<AGENT_ID>'], //List of agentIds. AGENT_ID is the emailID used to signup on Kommunicate
'botIds': ['<BOT_ID>'] //List of botIds. Go to Manage Bots(https://dashboard.kommunicate.io/bots/manage-bots) -> Copy botID
};
KommunicateFlutterPlugin.buildConversation(conversationObject)
.then((result) {
print("Conversation builder success: " + result.toString()); //result.toString() will be the clientChannelKey
}).catchError((error) {
print("Conversation builder error occurred : " + error.toString());
});
Note: Refer this to use other paramters for creating the converstion, like metadata etc
Rich Message
Rich message provide a better overall conversational experience to the users, make the interface look pretty, they also drive more actions from your users and provide a good conversational experience. There are a variety of response types to choose from. For example, you can show images, play videos, provide buttons, list, forms, or card carousels.
Refer the following link to use rich messages in Kommunicate.