Developer Docs | Kommunicate

Developer Docs | Kommunicate

  • Book a Demo
  • Try For Free

›Flutter Mobile

Web

  • Installation
  • CMS Installation
  • Authentication
  • Conversation
  • Conversation Assignment
  • Customization
  • Localization
  • Logout
  • Troubleshooting

Android

  • Installation
  • Authentication
  • Push Notification
  • Conversation
  • Customization
  • Localization
  • Logout
  • Migration
  • Troubleshooting

iOS

  • Installation
  • Authentication
  • Push Notification
  • Conversation
  • Customization
  • Configuration
  • Localization
  • Logout
  • Troubleshooting

React Native

  • Installation
  • Expo Installation
  • Authentication
  • Push Notification
  • Conversation
  • Customization
  • Logout
  • Troubleshooting

Flutter Mobile

  • Installation
  • Authentication
  • Push Notification
  • Conversation
  • Customization
  • Localization
  • Troubleshooting

Flutter Web

  • Installation
  • Authentication
  • Conversation

Ionic/Cordova

  • Installation
  • Authentication
  • Push Notification
  • Conversation
  • Customization
  • Localization
  • Logout
  • Resolving Errors

Ionic/Capacitor

  • Installation
  • Authentication
  • Push notification
  • Customization

Rich Messages

  • How To Use
  • Types of Rich Messages

Bots

  • Bot setup
  • Dialogflow Integration
  • Lex Integration
  • Kompose Bot Builder
  • IBM Watson Integration
  • Custom Bot Integration
  • Import Kompose Bot
  • Bot Samples

Integrations

  • Zapier
  • WhatsApp
  • WhatsApp 360Dialog
  • WhatsApp Twilio
  • WhatsApp Cloud API
  • Instagram Integration
  • Telegram Integration
  • Sunshine Integration
  • Freshdesk Integration
  • Pipedrive Integration
  • Agile Integration

Platform APIs

  • Authentication
  • Endpoints

Dashboard Features

  • Analytics
  • Conversations
  • Users
  • Bot Integration
  • Helpcenter
  • Campaign Messaging
  • Settings

Configuration

  • Single Sign On (SSO) Setup
  • Webhooks
  • Access Token URL
  • Email Fallback

Conversation

Launch conversation

Kommunicate provides buildConversation function to create and launch conversation directly saving you the extra steps of authentication, creation, initialization and launch. You can customize the process by building the conversationObject according to your requirements. To launch the conversation you need to create a conversation object. This object is passed to the buildConversation function and based on the parameters of the object the conversation is created/launched.

Below are some examples to launch conversation in different scenarios:

Launch conversation for visitor

If you would like to launch the conversation directly without the visiting user entering any details, then use the method as below:

    dynamic conversationObject = {
     'appId': '<APP_ID>',// The [APP_ID](https://dashboard.kommunicate.io/settings/install) obtained from kommunicate dashboard.
     };

    KommunicateFlutterPlugin.buildConversation(conversationObject)
        .then((clientConversationId) {
      print("Conversation builder success : " + clientConversationId.toString());
    }).catchError((error) {
      print("Conversation builder error : " + error.toString());
    });

Launch conversation for visitor with lead collection

If you need the user to fill in details like phone number, emailId and name before starting the support chat then launch the conversation with withPreChat flag as true. In this case you wouldn't need to pass the kmUser. By this, A screen would open up for the user asking for details like emailId, phone number and name. Once the user fills the valid details (atleast emailId or phone number is required), the conversation would be launched. Use the function as below:

    dynamic conversationObject = {
         'appId': '<APP_ID>',// The [APP_ID](https://dashboard.kommunicate.io/settings/install) obtained from kommunicate dashboard.
         'withPreChat': true
      };

    KommunicateFlutterPlugin.buildConversation(conversationObject)
        .then((clientConversationId) {
      print("Conversation builder success : " + clientConversationId.toString());
    }).catchError((error) {
      print("Conversation builder error : " + error.toString());
    });

Launch conversation with existing user

If you already have the user details then create a kmUser object using the details and launch the conversation. Use the method as below to create kmUser with already existing details:

   dynamic user = {
       'userId' : '<USER_ID>',   //Replace it with the userId of the logged in user
       'password' : '<PASSWORD>'  //Put password here if user has password, ignore otherwise
     };
     dynamic conversationObject = {
         'appId': '<APP_ID>',// The [APP_ID](https://dashboard.kommunicate.io/settings/install) obtained from Kommunicate dashboard.
         'kmUser': jsonEncode(user)
      };

    KommunicateFlutterPlugin.buildConversation(conversationObject)
        .then((clientConversationId) {
      print("Conversation builder success : " + clientConversationId.toString());
    }).catchError((error) {
      print("Conversation builder error : " + error.toString());
    });

Note: jsonEncode requires the dart package dart:convert. Make sure you have imported the package at the top of the dart file as import 'dart:convert';

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>);

Start 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
           'conversationAssignee':'<AGENT_ID/BOT_ID>' /// To set the conversation assignee, pass AgentId or 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

Conversation Object

Below are all the parameters that can be used to customize the conversation according to requirements:

ParametersTypeDescription
appIdStringThe APP_ID obtained from Kommunicate dashboard
kmUserkmUserOptional, Pass the details if you have the user details, ignore otherwise. The details you pass here are used only the first time, to login the user. These login details persist until the app is uninstalled or you call logout.
withPreChatbooleanOptional, Pass true if you would like the user to fill the details before starting the conversation. If you have user details then you can pass false or ignore.
skipConversationListbooleanOptional: Pass true if you want to skip the conversation list screen and directly open the conversation page.
isSingleConversationbooleanOptional, Pass true if you would like to create only one conversation for every user. The next time user starts the conversation the same conversation would open. Pass false if you would like to create a new conversation every time the user starts the conversation. True is recommended for single-threaded conversation.
messageMetadatadynamicOptional. This metadata if set will be sent with all the messages sent from that device. Also, this metadata will be set to all the conversations created from that device.
agentIdsArray of StringOptional, Pass the list of agents you want to add in this conversation. The agent ID is the email ID with which your agent is registered on Kommunicate. You may use this to add agents to the conversation while creating the conversation. Note that, conversation assignment will be done on the basis of the routing rules set in the Conversation Rules section. Adding agent ID here will only add the agents to the conversation and will not alter the routing rules.
botIdsArray of StringOptional, Pass the list of bots you want to add in this conversation. Go to bots -> Manage Bots -> Copy botID . Ignore if you haven't integrated any bots. You may use this to add any number of bots to the conversation while creating the conversation. Note that this has no effect on the conversation assignee, as the Conversation Rules set forth in the Dashboard will prevail.
conversationAssigneeStringOptional, Pass either the agentId or botId. The conversation created will skip the routing rules and will be assigned to this agent or bot. You also need to pass the agentId in agentIds array or botId in the botIds array, if you are using the conversationAssignee parameter.
clientConversationIdStringOptional, Pass the unique id using which you can recognize the conversation. For e.g If you have a shopping app and each order has its specific conversation, the orderId of the order can be used as a clientConversationId. In this case everyId will have its specific conversation.
conversationTitleStringOptional, Pass the custom title for a conversation. Use this if you would like to display a custom title instead of the conversation assignee name.
launchAndCreateIfEmptybooleanOptional, Pass true if you need to create the conversation and launch it. You will receive the clientChannelKey of the created conversation in the success callback function.
createOnlybooleanOptional, Pass true if you need to create the conversation and not launch it. In this case you will receive the clientChannelKey of the created conversation in the success callback function.

Update TeamId

To update the teamId of a conversation, use the below method:

KommunicateFlutterPlugin.updateTeamId({
  //'conversationId': <conversation id>,
  'clientConversationId': '<client conversation id>',
  'teamId': '<team id>'
})

We can pass either conversationID (integer) or clientConversationID (string) in the object. Once team is updated, conversation will be assigned to that team.

Send data to bot platform

You can set the data you want to send to the bot platform by calling the updateChatContext method as below:

  dynamic chatContext = {
          'key': 'value',
          'objKey': {
            'objKey1' : 'objValue1',
            'objKey2' : 'objValue2'
          }
        };

  KommunicateFlutterPlugin.updateChatContext(chatContext);

Get Unread Count

To get unreadCount of a user, use this method after the user has been logged in:

KommunicateFlutterPlugin.unreadCount()
    .then((result) {
  print("Unread count is : " + result.toString());})

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.

  • Rich Messages
← Push NotificationCustomization →
  • Launch conversation
    • Launch conversation for visitor with lead collection
    • Launch conversation with existing user
  • Launching chat screen
  • Launching individual chat thread
  • Start a new Conversation
  • Conversation Object
  • Update TeamId
  • Send data to bot platform
  • Get Unread Count
  • Rich Message

Ready to automate more than 80% of your customer support?

Try for Free
  • support@kommunicate.io
  • United States
    (+1) (310) 402-2374
  • India
    (+91) 974-057-0196
  • Learn
    • iOS Chatbot
    • Amazon Lex Chatbot
    • Chatbot in Android
    • ChatGPT with Flutter
    • Document to Chatbot
    • React Native Chatbot
    • Create Flutter Chatbot
    • Whatsapp Business API
    • Integrate React Js Chatbot
    • Whatsapp Chatbot Using NodeJs
    • Integrate ChatGPT With Whatsapp
    • Integrate Dialogflow With Whatsapp
    • ChatGPT For Product Engagement
    • Product
    • AI Chatbot Builder
    • Generative AI Chatbot
    • Customer Experience
    • Chatbot Features
    • Dialogflow Integration
    • FAQ Chatbot
    • Live Chat
      Industries
    • Healthcare Chatbot
    • E-commerce Chatbot
    • Education Chatbot
    • Banking Chatbot
  • Integrations
    • E-commerce Chatbot Integration
    • Omnichannel Chatbot
    • Chatbot Integration
    • Chatbot for Website
    • Mobile Apps Chatbot
    • Chatbot for CRM's
    • Automation and Analytics
    • Zendesk Chatbot Integration
  • Resources
    • Chatbots Templates
    • Case Studies
    • Whitepapers
    • Chatbot Guide
    • Videos
    • Knowledge Hub
    • Comparisons
    • ROI Calculator
    • Blogs
    • Company
    • Partner Program
    • Affiliate Program
    • Pricing
    • About Us
    • Media
      Support
    • Contact Us
    • HelpCenter
    • Stack Overflow
    • API Status
  • Comapare
    • Kommunicate Vs Verloop
    • Kommunicate Vs Intercom
    • Kommunicate Vs Yellow
    • Kommunicate Vs Twak
    • Kommunicate Vs Ada
Arabic
Hindi
Spanish
French
German
Portuguese
Urdu
Software Advice Frontrunners for Live Chat Mar-22Software Advice Frontrunners for Live Chat Mar-22crozdesk badgeISO certificationHIPAA complianceGDPR compliant - GDPR Copy 12Created with Sketch.COMPLIANT
Copyright © 2025 Kommunicate.io.
T&C Privacy Policy Career SLA DPA Sitemap