logo
On this page

Message component

The message component of the In-app Chat Kit provides the message list and message transmission features.

Note
If you don't need the Conversation List, you can directly use the message component.
  • Message list: Allow you to view the message history of a chat.
  • Message transmission: Allow you to send or receive one-to-one messages and group messages.
ce389206-8c2f-41e0-9072-eaa39bbc431f.gif

Integrate the message component into your project

Prerequisites

Integrate the In-app Chat Kit SDK into your project (finished the initialization and login are required). For more information, see Quick start.

Show the message component

ViewController.swift
import UIKit
import ZIMKit

/// your ViewController.swift
class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
    }
    
    /// Call the following method to display the message component after login succeeded.
    func showMessageListVC() {
        let conversationID = "xxx"  // Conversation ID. For one-on-one chats, it refers to the peer's userID. For group chats, it refers to the GroupID. 
        let type: ConversationType = .peer // Conversation type (one-on-one chats or group chats). 
        let messageVC = ZIMKitMessagesListVC(conversationID: conversationID, type: type)
        navigationController?.pushViewController(messageVC, animated: true)
    }
}
1
Copied!

Customize features

If the default message-relevant features and behaviors don't fully meet your needs, we allow you to flexibly customize those through the config we mentioned in this section.