Sending Messages
Text Messages
Image Messages
Custom Messages
Reference custom messages: Custom MessagesMessage Storage Callback (Not Message Send Status)
When sending messages, the SDK will trigger a storage callback after saving the message to the local database. At this point, the message has not been sent yet, and you can display the message in the UI in this listener. Listen for message storage events:New Messages
Listen for new message events:If you receive new messages in a chat page, you need to determine whether the message belongs to the current conversation by checking the
channelID and channelType of the message object WKMsgMessage Refresh Listening
When the SDK updates messages, such as: message send status, someone likes a message, message read receipt, message recall, message editing, etc., the SDK will callback the following event. The UI can determine which specific message has changed through theclientMsgNO of the message object WKMsg.
Listen for refresh message events:
Message Send Status Code (ReasonCode)
When a message is sent, you can obtain theWKMsg object by listening for message refresh events. The status (send status) and reasonCode in WKMsg indicate the result of the message delivery.
View Chat Information for a Channel
Getting history messages is not a synchronous method, as there may be non-continuous data that needs to be synced from the server
Complete Message Management Example
Offline Messages
Need to implement sync channel message data source Channel Message Data Source
Because WuKongIM supports permanent message storage, it will generate massive offline messages. For this, we adopt an on-demand pull mechanism. For example, with 10 conversations each having 100,000 messages, WuKongIM will not pull all 10*100,000=1 million messages to local storage. Instead, it pulls information for these 10 conversations and the corresponding latest 20 messages, which means actually only 200 messages are pulled. Compared to 1 million messages, this greatly improves offline pull speed. Users will only pull messages for a specific conversation when they enter that conversation. These mechanisms are already encapsulated within the SDK, so users don’t need to worry about them. Users only need to focus on recent conversation changes and listen for data retrieval callbacks.
Data Structure Description
Message Class Core Properties
Message Content Body
Next Steps
Channel Management
Learn how to manage channels and groups
Conversation Management
Handle conversation lists and unread messages
Data Source Configuration
Configure message data sources
Advanced Features
Explore advanced features and custom messages

