Class OnReceiveMessageWrapperListener

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract void onReceivedMessage(Message message, ReceivedProfile profile) Receives real-time or offline messages.
      boolean onReceived(Message message, int left, boolean hasPackage, boolean offline) Receives real-time or offline messages.
      • Methods inherited from class io.rong.imlib.IRongCoreListener.OnReceiveMessageWrapperListener

        onOfflineMessageSyncCompleted, onReceived, onReceived
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OnReceiveMessageWrapperListener

        OnReceiveMessageWrapperListener()
    • Method Detail

      • onReceivedMessage

         abstract void onReceivedMessage(Message message, ReceivedProfile profile)

        Receives real-time or offline messages. Note: Switch threads to handle time-consuming operations.

        Parameters:
        message - The received message object
        profile - ReceivedProfile, which stores left (After the client successfully connects, the server will deliver all compensation messages in packages to the client, with a maximum of 200 messages per package.
      • onReceived

         boolean onReceived(Message message, int left, boolean hasPackage, boolean offline)

        Receives real-time or offline messages.

        Note: 1. For offline messages, the server packages 200 messages into a single bundle and sends it to the client, which then parses the bundle. 2. `hasPackage` indicates whether there are remaining message bundles, and `left` indicates how many messages are left in the current bundle after parsing and delivering them to the app layer. How to determine if all offline messages have been received: 1. Both `hasPackage` and `left` are 0; 2. `hasPackage` being 0 indicates that the client is receiving the last bundle (200 messages), and `left` being 0 indicates that the last message in the final bundle has been received.

        Parameters:
        message - The received message object.
        left - When the client successfully connects, the server sends all compensation messages in bundles, with a maximum of 200 messages per bundle (i.e., a Package).
        hasPackage - Indicates whether there are undelivered message bundles on the server.
        offline - Indicates whether the message is an offline message.
        Returns:

        Whether the message was processed. Returns true if the app processed the message; otherwise, returns false for the SDK to handle.