Observe reading count
Last updated
Last updated
The SDK provides the startMessageReceiptSync() function to enable the observation of reading/delivered status within the chatroom. It is essential to initiate this functionality to receive real-time updates on message read/delivered counts. If the client doesn't start observing, it won't receive any updates regarding the read/delivered count.
Note: Observing reading status consumes real-time event topics. Therefore, it is recommended to stop observing when the user exits the chatroom using stopMessageReceiptSync().
To start observing reading status, call the startMessageReceiptSync() function:
This action ensures that the client receives real-time updates on the reading/delivered status of messages in the chatroom.
When the user exits the chatroom or when observation is no longer required, it is crucial to stop observing reading status to conserve resources and prevent unnecessary real-time event consumption. Use the stopMessageReceiptSync() function for this purpose:
Stopping observation ensures that the client no longer receives real-time updates on message read/delivered counts.
Lifecycle Management: Start observing reading status when the user enters the chatroom and stop observing when the user exits to optimize resource usage.
Real-time Event Topics: Be mindful that observing reading status consumes real-time event topics, and unnecessary observation can lead to reaching the limit quota to receive real-time events in the SDK.
Resource Optimization: Stop observation when it is no longer required to conserve resources and improve overall performance.