Developer Docs | Kommunicate

Developer Docs | Kommunicate

  • Book a Demo
  • Try For Free

›iOS

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

Authentication

Setup

There is a setup call that you need to do before registration or login. You can get your APP_ID by signing up on Kommunicate dashboard. In your AppDelegate, first import Kommunicate:

import Kommunicate

Then, in the application:didFinishLaunchingWithOptions: method, setup Kommunicate as shown below

Kommunicate.setup(applicationId: <APP_ID>)

    func application(
        _: UIApplication, 
        didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]?
        ) -> Bool {

        Kommunicate.setup(applicationId: <APP_ID>)
        return true
    }

In case of 'no such module' error, check the following troubleshooting intsruction:

Once you complete the pod installation, close the project and open .xcworkspace file then build the project to avoid the above mentioned error.

Registration/Login

Convenient methods are present in Kommunicate class to register a user on Kommunicate.

Currently we support two different types of users on our iOS SDK:

1. Visitors

To register a user as a visitor to the Kommunicate server, follow these steps:

  1. Create a Visitor User Object
    • Generate a KMUser object with a random user ID using the createVisitorUser method from the Kommunicate class:
   let kmUser = Kommunicate.createVisitorUser()
   kmUser.applicationId = <APP_ID> // pass your Kommunicate Application ID 
  1. Register the User as a Visitor
    • Register the user as a visitor on the Kommunicate server using the registerUserAsVisitor method from the Kommunicate class:
   Kommunicate.registerUserAsVisitor(kmUser, completion: { response, error in
       guard error == nil else { return }
       print("Success")
   })   

2. Pre chat Lead Collection

To collect user contact information before initiating a chat, you can show the Pre-Chat view using the following steps:

  1. Show the Pre-Chat View
    • Initialize and configure the KMPreChatFormViewController:
   let preChatVC = KMPreChatFormViewController(configuration: Kommunicate.defaultConfiguration)
   preChatVC.delegate = self // Set the delegate to self to receive callbacks
   preChatVC.preChatConfiguration.optionsToShow = [.email, .name, .phoneNumber] // Configure options to be visible in pre-chat
   preChatVC.preChatConfiguration.mandatoryOptions = [.email, .name, .phoneNumber] // Configure mandatory options
   self.present(preChatVC, animated: false, completion: nil) // Present the pre-chat view

Pre-chat view screenshot

  1. Handle Callbacks
    • Confirm your ViewController to the KMPreChatFormViewControllerDelegate to handle user actions when they tap the submit or close button:
   extension ViewController: KMPreChatFormViewControllerDelegate {

       func userSubmittedResponse(name: String, email: String, phoneNumber: String, password: String) {
           self.dismiss(animated: false, completion: nil)

           let kmUser = KMUser()
           kmUser.userId = <pass a unique key>  // Create a Unique ID for each user. You can use this Id to perform login.
           kmUser.applicationId = <APP_ID>  // pass your Kommunicate Application ID 
           kmUser.displayName = name
           kmUser.email = email
           kmUser.contactNumber = phoneNumber

           Kommunicate.registerUser(kmUser, completion: { response, error in
               guard error == nil else { return }
               print("Success")
           })
       }

       func closeButtonTapped() {
           self.dismiss(animated: false, completion: nil)
       }
   }

3. Registered User

If the user is logged into your app, you can pass the user information as follows:

To register a user to the Kommunicate server, use the method from the Kommunicate class:

  1. Create a KMUser Object
    • Initialize a KMUser object and set its properties:
   let kmUser = KMUser()
   kmUser.userId = <pass a unique key>  // Create a Unique ID for each user. You can use this Id to perform login.
   kmUser.applicationId = <APP_ID>  // pass your Kommunicate Application ID 
   kmUser.displayName = displayName
   kmUser.email = <pass user's emailId> // Optional
  1. Register the User
    • Pass the KMUser object to the registerUser method to register the user on the Kommunicate server. This API can also be used for login:
   Kommunicate.registerUser(kmUser, completion: { response, error in
       guard error == nil else { return }
       print("Success")
   })

Pass additional details as metadata

Sometimes, you may need to pass additional details for the user apart from the already existing properties of KMUser. You can pass the additional details in metadata of the KMUser object.

// This is example data. You can set it according to the additional details you want to add
let userMetadata = NSMutableDictionary()
userMetadata["department"] = "Engineering"
userMetadata["designation"] = "Software Engineer"
userMetadata["team"] = "Device Team"

kmUser.metadata = userMetadata

To check if user is already logged in, use below API:

if Kommunicate.isLoggedIn {
  // User is already logged in
}

Note: To avoid calling in registration everytime use isLoggedIn to check if the user is already logged in or not.

What Next?

  1. Check out the Conversation Section where you will get the details for creating and launching a conversation.
  2. Enable Push Notifications to get real-time updates.
← InstallationPush Notification →
  • Setup
  • Registration/Login
    • 1. Visitors
    • 2. Pre chat Lead Collection
    • 3. Registered User
  • Pass additional details as metadata

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